Click here to Skip to main content
15,922,419 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: enter password only can in algha&num. Pin
eileenpp12-Dec-05 15:52
eileenpp12-Dec-05 15:52 
GeneralRe: enter password only can in algha&num. Pin
Christian Graus12-Dec-05 15:54
protectorChristian Graus12-Dec-05 15:54 
Questionhow can i check my network is connected Pin
Your Code12-Dec-05 14:49
Your Code12-Dec-05 14:49 
AnswerRe: how can i check my network is connected Pin
MarcelErz12-Dec-05 20:44
MarcelErz12-Dec-05 20:44 
GeneralRe: how can i check my network is connected Pin
Your Code13-Dec-05 16:51
Your Code13-Dec-05 16:51 
GeneralRe: how can i check my network is connected Pin
MarcelErz13-Dec-05 21:09
MarcelErz13-Dec-05 21:09 
AnswerRe: how can i check my network is connected Pin
Briga12-Dec-05 22:35
Briga12-Dec-05 22:35 
AnswerRe: how can i check my network is connected Pin
Steve Pullan14-Dec-05 11:37
Steve Pullan14-Dec-05 11:37 
It has been mentioned that .NET Framework 2.0 has the smarts to do this. Here's a brief rundown on what is required. I found the basis for this post at The Occasionally Connected Application[^].

I just setup a simple one-form app which had one label on it. The label is changed to "Connected" or "Not Connected" depending on the state of the network. The initial state is detected via this code in the Form_Load event ...

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    If My.Computer.Network.IsAvailable = True Then
        lblConnectedStatus.Text = "Connected"
    Else
        lblConnectedStatus.Text = "Not Connected"
    End If

End Sub


Now we need to dynamically test the connection state. This is done by creating an event handler for the NetworkAvailabilityChanged in the MyApplication class ...

Private Sub MyApplication_NetworkAvailabilityChanged(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs) Handles Me.NetworkAvailabilityChanged

    If e.IsNetworkAvailable = True Then

        My.Forms.Form1.lblConnectedStatus.Text = "CONNECTED"

    Else

        My.Forms.Form1.lblConnectedStatus.Text = "Not Connected"

    End If

End Sub


This passed most of the unplug / disable tests. Use this in conjunction with the new Ping functions in 2.0 and you may have a viable solution.

...Steve

"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life."
(Translation: I'll show you the way, but not write the code for you.) I read that somewhere once Smile | :)
QuestionUsing Marquee in VB.Net Pin
kids1712-Dec-05 12:20
kids1712-Dec-05 12:20 
AnswerRe: Using Marquee in VB.Net Pin
Christian Graus12-Dec-05 12:26
protectorChristian Graus12-Dec-05 12:26 
AnswerRe: Using Marquee in VB.Net Pin
Curtis Schlak.12-Dec-05 13:00
Curtis Schlak.12-Dec-05 13:00 
NewsHello everybody Pin
Borun12-Dec-05 10:06
Borun12-Dec-05 10:06 
GeneralRe: Hello everybody Pin
Steve Pullan12-Dec-05 12:49
Steve Pullan12-Dec-05 12:49 
GeneralRe: Hello everybody Pin
Borun13-Dec-05 3:10
Borun13-Dec-05 3:10 
GeneralRe: Hello everybody Pin
Curtis Schlak.13-Dec-05 4:46
Curtis Schlak.13-Dec-05 4:46 
QuestionRegistry entries don't show up Regedit, but are set in UI in VS Pin
depotdog12-Dec-05 7:21
depotdog12-Dec-05 7:21 
QuestionHTTPS credentials with proxy? Pin
matsnas12-Dec-05 3:14
matsnas12-Dec-05 3:14 
QuestionNeed a button that works Pin
patrick king12-Dec-05 2:52
patrick king12-Dec-05 2:52 
AnswerRe: Need a button that works Pin
MarcelErz12-Dec-05 4:30
MarcelErz12-Dec-05 4:30 
AnswerRe: Need a button that works Pin
Christian Graus12-Dec-05 12:29
protectorChristian Graus12-Dec-05 12:29 
Questionhow do you set an item to be selected in the combobox in vb6? Pin
bonosa12-Dec-05 2:49
bonosa12-Dec-05 2:49 
AnswerRe: how do you set an item to be selected in the combobox in vb6? Pin
MarcelErz12-Dec-05 3:53
MarcelErz12-Dec-05 3:53 
AnswerRe: how do you set an item to be selected in the combobox in vb6? Pin
AminMaredia13-Dec-05 21:29
AminMaredia13-Dec-05 21:29 
GeneralRe: how do you set an item to be selected in the combobox in vb6? Pin
bonosa14-Dec-05 15:06
bonosa14-Dec-05 15:06 
Questionmodifying dll Pin
uktrips00712-Dec-05 0:06
uktrips00712-Dec-05 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.