C# :: Reconnecting To Internet If Connection Drops

Jan 24, 2014

I am currently writing a small windos form app which relies on an internat connection.

The only issue I have is trying to find out how to force the app to reconnect if the internet drops out without the app crashing. From what I have read I could use "try and catch" but I am not sure how to do this.

The code I have so far is: for testing I am using [URL] as the web site target.

Form1.Designer:

namespace Browser2014
{
partial class Form1
{

[Code]....

View 3 Replies


ADVERTISEMENT

C++ :: Windows Socket Makes App Crash If No Internet Connection

Oct 18, 2014

I'm strugling to understand why my app is crashing if there is no internet connection.

Code:
int main() {
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
std::cout << "WSAStartup failed.

[Code] ....

Debug crash code:

Code:
First-chance exception at 0x00161831 in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x0000000C.
Unhandled exception at 0x00161831 in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0x0000000C.

It works well as long as the computer is connected to internet but if i disconect from internet the application crash but don't understand why.

View 4 Replies View Related

C Sharp :: SQL Server Connection String To Connect Through Domain Name (internet)

Sep 20, 2012

I have tried to connect my sql server 2005 using a domain name. i have bought a domain name and a dns client. this is my connection string

{ SqlConnection sqlconn = 
 new SqlConnection("user id=user1;" + "password=pass2;"
  + "server=www.mysite.infoServerInstance;" 
+ "trusted_Connection=false;" + "network 
library=DBMSSOCN;" + "Integrated security=false;" 
+ "initial catalog=Mydatabase;" +"connection timeout=5
;"); }

I have added sql browser & sql server in fire wall, and also enabled tcp port 1433 and udp port 1434. the above connection string works perfect when i run it in the server machine, but whenIi try to run it on other machines I am getting an error that server is not available or cannot find the specified server.. I desperately need to access my database through an url. ie., through internet..

View 6 Replies View Related

C++ :: Connecting 2 Computers Over Internet

Oct 19, 2014

I'm trying to make my 1v1 game playable online and I would like to have the 2 players connected directly rather than trough a server.

The problem I'm having is that I don't have any experience with server client communication or internet libraries in c++

View 4 Replies View Related

C++ :: Block Internet Access To A PC?

Jun 18, 2012

I need to turn off internet access for SPECIFIC website locations. I use C++ Builder 2010 or Delphi 2010.

View 5 Replies View Related

C :: Currency Conversion Update From Internet

Jun 15, 2013

i have given a project for currency conversion program with add,delete,search,display option. but i was thinking if it can update the currency rate from internet at beginning.

View 3 Replies View Related

C/C++ :: How To Take Data From Internet In Real Time

Apr 17, 2015

How i can take data from internet n real time i want make program wich alarm when a specific site(from my university) have a announcement...

View 6 Replies View Related

Visual C++ :: How To Get History Of Internet Explorer

Dec 27, 2013

Now i want to get history of IE by c++.But i started learning c++, so i do not know!

View 1 Replies View Related

C# :: How To Share Video File Between Multiple PC Over Internet

Jul 2, 2014

Basically i'm willing to create an application which could share Video,Mp3 Over the internet to my friends.

For suppose I'm hosting file on my PC, and i want to share "D" Drive to my friends but they aren't connected to my network locally. i want to share movies over the internet using a host and client application in c#.net.

the purpose of this application is very clear that that i want to share movies over the internet and they have to be able to watch movies on their PCs Except running my PC remotely.

View 8 Replies View Related

C# :: How To Disable And Enable LAN Connection In WPF

Jun 22, 2014

i have tried to search on the Internet but haven't found a suitable result that links in with what I want to do, that is to creation a WPF application and when you press a enable button it will enable the LAN and when I click the disable button it will disable the LAN until i click the enable button again. Now I know how to creation a WPF and the buttons, but how would I do the disabling LAN and enabling LAN?

By LAN i mean just the networking adapters, so that the PC cannot connect to a router and then the Internet.

View 14 Replies View Related

Visual C++ :: Internet Explorer Displays Blank Page When Opening Local File While Screen Is Off?

Apr 28, 2015

I'm making a small MFC module that should generate a report (formatted using HTML) and then display it for a user on schedule at 8:30 AM every day. Pretty straightforward stuff.

I compose my report and then save it as a local HTML file in the CSIDL_APPDATA folder. I then use the following calls to display it using the default web browser (Internet Explorer in this case):

Code:
//Error checks are omitted for brevity
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
ShellExecute(NULL, NULL, strSaveFileTo, NULL, NULL, SW_SHOWNORMAL);

This module is run on schedule from the Task Scheduler. (The task is set up to run when a user is logged on, which is all the time for that PC. It is never turned off, put to sleep, etc. That computer has only one user that is never logged off either.)

This works perfectly fine when I test it by setting the task a minute or so in the future. But when the actual task is supposed to run at 8:30 AM, when the user wakes the screen all they see is a blank Internet Explorer page. (Note that if someone refreshes that page by hitting F5, only then my report is shown on the screen.)

So I started looking into it:

1) I checked that the file is properly saved (before calling ShellExecute) by reading it back and by comparing it with the original HTML markup that I saved earlier. It's all correct there.

2) I then checked the power saving options. That computer is set up to show screensaver after 5 minutes and to turn off screen after 25 minutes.

3) The web browser that causes this issue is IE version 11, with the latest updates installed. The operating system is Windows 7 Professional.

And why is IE showing a blank page only when computer is running unattended?

View 14 Replies View Related

C :: Getting Input From A Serial Connection (Hyperterminal)

Mar 15, 2013

Wondering why I cannot communicate with my microcontroller dspic33 with the Hyperterminal program. In the sample test code, I also cannot use printf. They have it set up differently and I am wondering if it is possible to redirect the output of the printf, scanf functions to the port I am using?

View 3 Replies View Related

C# :: Connection String With Relative Path

Jun 3, 2014

I have my application database in the AppDataRoaming folder. I'm trying to create a connection string for Telerik reporting, up until now I've had a connection string in a settings class that is put together like this:

The path is:

data source=C:UsersSynlightAppDataRoamingAppNamedataAppDB.sqlite

I've tried files paths like this:

%AppData%RoamingAppDatadataAppDB.sqlite

and

Server.MapPath(@"~App_DataRoamingAppDatadataAppDB.sqlite

(those are not the real directory names, of course). How do I create a connection string that will work on target machines?

View 5 Replies View Related

C# :: Null Reference With Connection String

Nov 29, 2014

private DataSet1 GetData(string query) {
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;

The above is erring out with NullReferenceException

View 6 Replies View Related

C Sharp :: Could Not Open Connection To SQL Server

Feb 19, 2013

I'm getting this error.

SQLite error
near "16": syntax error

On the code:

private void btnUpdate_Click(object sender, EventArgs e)
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{

[Code]....

With breapoints etc it does show the values it has to insert into my database. But it just doesn't and gives me the Near "16" syntax error.

View 50 Replies View Related

C++ :: How To Give Database Connection To Code

Apr 11, 2013

how to give a database connection to a c++ code i am using turbo c++ as an editor and if i have oracle 11g client, odbc as a driver , what else i require and how to link these things in a code.

View 1 Replies View Related

C++ :: HTTP POST Request - Connection Failure

Apr 22, 2014

I have issues with this i am new to winsock. so i was learning to use winsock for http POST request

Compiles correctly, but doesnt connect i get the error "Connection Failure" what do you think can be wrong

My code goes like this:

Code: #define WIN32_LEAN_AND_MEAN
#include "stdafx.h"
#include <cstdio>
#include <cstdlib>
#include <Winsock2.h>

[Code] .....

View 1 Replies View Related

C++ :: Command Line And Waiting For A Connection (Socket)

Feb 7, 2014

I am designing a server program in C++ and now that everything works for the clients, I would like to implement a command line. The code waits for a connection with the predefined function "new_socket = accept(serversocket,(struct sockaddr *)&client,&addrsize);". I already made a function for the command line but I can't find a way (in my brain or on the web) to accept commands (getline) whilst no connection is accepted yet. (I mean wait for a connection. If no connection, then be ready to receive some arguments from the command line). Here is part of the code:

cout << "Waiting for connection/command...";
command_line_function(); //getline(cin,string)
while(true){
new_socket = accept(serversocket,(struct sockaddr *)&client,&addrsize);
if(new_socket == INVALID_SOCKET){ //INVALID_SOCKET is an error somehow.
error_function();}
cout << "ACCEPTED
";
//etc.
}

View 5 Replies View Related

C# :: MySQL Exception Connection Unexpectedly Terminated

Jul 10, 2014

I am currently developing a sync module using asp.net. I am getting data from an external database (mysql database) The problem is I am getting the error "Connection unexpectedly terminated" when filling the dataset.

Here's my code

string P_contact = "SELECT A.id, B.firstname, B.middlename, B.lastname FROM Accounts A, Contacts B WHERE A.id = B.id";
MySqlDataAdapter db_P_contact = new MySqlDataAdapter(P_contact, conn);
DataSet ds3 = new DataSet();
DataTable dt3 = new DataTable();

[Code] ....

I am getting the exception on this line of code:

db_P_contact.Fill(ds3, "P_contact");

View 3 Replies View Related

C# :: Access Database Connection And Saving Data

Mar 17, 2014

I want to connect an access database (.mdb) to my Windows Forms application - this I can do and I have no problems viewing my table in server explorer.

Some code example or template that I can use as a base to learn from - I have literally trawled Google and Youtube and cannot find what I am after.

What I want to do is have a basic form, 2 text boxes and a button to save the data to my database.

FirstName and LastName are the 2 boxes.

View 6 Replies View Related

C# :: How To Parse Information Into A Connection String For EF (Oracle Db)

Aug 25, 2014

So when I create the EF and use generate model from the database, I included the sensitive info into the connection string. Now I want to get the user to input password, userID, schema name, host into the connection string. I use Oracle as my database, so there is a need to put the schema name in it also.... How do I accomplish this task? Been trying to get it work but unsuccessful so far...

View 3 Replies View Related

C# :: Concurrent Sharp Panel Connection With Semaphores And Buffers

Apr 26, 2014

I have a problem with my C#. Trying to create the airstrip with planes heading out of the hangars and on to the road to the airstrip. Each Hangar pannel is connected with closes road to them. What i am stuck with right now is connecting the roads together so each one of them will see if the next road is free and if it is it will send the plane (colorder square for now) to it and then proceed to the next one when finaly they will line up for the final panel(airstrip) and take off.So far they are just going down the each road they are assigned with semaphore and thread.

using System;
using System.Windows.Forms;
using System.Threading;
using System.ComponentModel;
using System.Collections;
using System.Data;
using System.Drawing;

[Code] ....

Connecting the "p2" with "p5" so the graphics from "p1" the square will travel through P2 and P5 this would be great and will allow me to procede with my studies.

Also i do realise that this might not be the best ways of using concurrent Csharp and not the up to date one but this is what i have been assigned with and do not have any other options unfortunately.

How i understand this is that i need to have 3 buffers and 3 semaphores for each panel. But i do not know how to add those to each one of them and then connect it with the next one as if i try and add them it either puts a cross in the design view over that panel or says that there is limited options for this statement.

This is the way that i want to do it unfortunately it must be so. The most flexible this can be is by adding an array for semaphores and buffer ( do not know how to do that either).

View 7 Replies View Related

C Sharp :: Winform Installer Error From Database Connection

Aug 20, 2013

I was created winform application with sql data base, after i created it i was converted to the installer file,for the other users but when they run the application did not connect to the database, how i fix this stuff...?

View 1 Replies View Related

C# :: Make Connection Between Access 2013 And Visual Studio 2010?

Mar 27, 2014

I want make connection between access 2013 and visual studio 2010(c#) but the error below is displaying

View 7 Replies View Related

C++ :: Publish Data Over The Internet In Peer To Peer Style Communication?

Sep 24, 2012

I need to be able to publish data between multiple machines at remote locations. I have been able to send data between two machines on a network in the same room. However, how to begin with resolving IPs for machines on other networks that are miles away etc. I would assume the application would need to LISTEN & PUBLISH in order to achieve this?

I have also googled this, and can only seem to find C# examples, and they seem to be for data between remote computers on the same network... What I need is to be able to find some guidance on sending data between me and someone who I previously had no knowledge of. I know this must be possible due to the fact that p-2-p chat clients exist, and that p-2-p file sharing exists.

View 1 Replies View Related

C# :: Server Application Using Tcp Protocol And Then Establish Connection With A Client Application

Nov 29, 2014

What happens if I make a server application using tcp protocol and then establish connection with a client application but the server crash and then the client send data. Will the data be lost or the system will continue trying to send it?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved