• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Need to write to Text File

Medic25

Sexy Member
Im creating a Application to detect internet connection. Upon Disconnection i want to write to a .txt file with out pushing a button

Here is My code so far:

Code:
ublic Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()
        Timer2.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable = True Then
            Label1.Text = "Connected to The Internet"
            TextBox1.Text = "Connected to Internet"
        ElseIf System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable = False Then
            Label1.Text = "Disconnected From Internet"
            TextBox1.Text = "Disconnected From Internet"
        End If
    End Sub
    Private Sub Timer2_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        TextBox2.Text = TimeOfDay
    End Sub
End Class

Basic Lable1 says Connected or Disconected
same as TextBox1
TextBox 2 is a clock

I want to output to file on TextBox1 Change

so itl say mm/dd/yy - hh:mm Connected/Disconected.

i can use Dim Write as New for a button click,
But what would it be for a Form1 Events Text Changed?
 
Top