Import CLF Client GUI

This commit is contained in:
Fish 2004-10-05 10:43:54 +00:00
parent dc9c60a3c9
commit 752ae7b10d
14 changed files with 1753 additions and 0 deletions

13
.gitattributes vendored
View file

@ -1,4 +1,17 @@
* text=auto !eol
CLFClient/AssemblyInfo.vb -text
CLFClient/CLFClient.sln -text
CLFClient/CLFClient.vbproj -text
CLFClient/Listener/Listener.resx -text
CLFClient/Listener/Listener.vb -text
CLFClient/Listener/Listener.vbproj -text
CLFClient/LogMain.resx -text
CLFClient/LogMain.vb -text
CLFClient/loginform.resx -text
CLFClient/loginform.vb -text
CLFClient/main.resx -text
CLFClient/main.vb -text
CLFClient/maincode.vb -text
html/.htaccess -text
html/1stalertview.php -text
html/1stcustomer.php -text

31
CLFClient/AssemblyInfo.vb Normal file
View file

@ -0,0 +1,31 @@
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
<Assembly: CLSCompliant(True)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("BEFCC18C-85C2-4CEC-B755-F5CDF8D721C5")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
<Assembly: AssemblyVersion("1.0.*")>

27
CLFClient/CLFClient.sln Normal file
View file

@ -0,0 +1,27 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CLFClient", "CLFClient.vbproj", "{FF614386-2453-4087-A61B-39A03B83645B}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Listener", "Listener\Listener.vbproj", "{117DEB1E-D437-41D3-A81D-DCA1165CDEBD}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{FF614386-2453-4087-A61B-39A03B83645B}.0 = {117DEB1E-D437-41D3-A81D-DCA1165CDEBD}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{FF614386-2453-4087-A61B-39A03B83645B}.Debug.ActiveCfg = Debug|.NET
{FF614386-2453-4087-A61B-39A03B83645B}.Debug.Build.0 = Debug|.NET
{FF614386-2453-4087-A61B-39A03B83645B}.Release.ActiveCfg = Release|.NET
{FF614386-2453-4087-A61B-39A03B83645B}.Release.Build.0 = Release|.NET
{117DEB1E-D437-41D3-A81D-DCA1165CDEBD}.Debug.ActiveCfg = Debug|.NET
{117DEB1E-D437-41D3-A81D-DCA1165CDEBD}.Debug.Build.0 = Debug|.NET
{117DEB1E-D437-41D3-A81D-DCA1165CDEBD}.Release.ActiveCfg = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

177
CLFClient/CLFClient.vbproj Normal file
View file

@ -0,0 +1,177 @@
<VisualStudioProject>
<VisualBasic
ProjectType = "Local"
ProductVersion = "7.0.9466"
SchemaVersion = "1.0"
ProjectGuid = "{FF614386-2453-4087-A61B-39A03B83645B}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "CLFClient"
AssemblyOriginatorKeyFile = ""
AssemblyOriginatorKeyMode = "None"
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "WinExe"
OptionCompare = "Binary"
OptionExplicit = "On"
OptionStrict = "Off"
RootNamespace = "CLFClient"
StartupObject = "CLFClient.MainForm"
>
<Config
Name = "Debug"
BaseAddress = "285212672"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "true"
DefineTrace = "true"
DebugSymbols = "true"
IncrementalBuild = "true"
Optimize = "false"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Release"
BaseAddress = "285212672"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "false"
DefineTrace = "true"
DebugSymbols = "false"
IncrementalBuild = "false"
Optimize = "true"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
/>
<Reference
Name = "crystaldecisions.windows.forms"
AssemblyName = "CrystalDecisions.Windows.Forms"
HintPath = "..\..\..\..\windows\assembly\gac\crystaldecisions.windows.forms\9.1.3300.0__692fbea5521e1304\crystaldecisions.windows.forms.dll"
/>
<Reference
Name = "CrystalDecisions.Shared"
AssemblyName = "CrystalDecisions.Shared"
HintPath = "..\..\..\..\Program Files\Common Files\Crystal Decisions\1.0\Managed\CrystalDecisions.Shared.dll"
/>
<Reference
Name = "CrystalDecisions.ReportSource"
AssemblyName = "CrystalDecisions.ReportSource"
HintPath = "..\..\..\..\Program Files\Common Files\Crystal Decisions\1.0\Managed\CrystalDecisions.ReportSource.dll"
/>
<Reference
Name = "System.Web.Services"
AssemblyName = "System.Web.Services"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Web.Services.dll"
/>
<Reference
Name = "System.DirectoryServices"
AssemblyName = "System.DirectoryServices"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.DirectoryServices.dll"
/>
<Reference
Name = "System.ServiceProcess"
AssemblyName = "System.ServiceProcess"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.ServiceProcess.dll"
/>
<Reference
Name = "System.Messaging"
AssemblyName = "System.Messaging"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Messaging.dll"
/>
<Reference
Name = "System.Web"
AssemblyName = "System.Web"
HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Web.dll"
/>
</References>
<Imports>
<Import Namespace = "Microsoft.VisualBasic" />
<Import Namespace = "System" />
<Import Namespace = "System.Collections" />
<Import Namespace = "System.Data" />
<Import Namespace = "System.Drawing" />
<Import Namespace = "System.Diagnostics" />
<Import Namespace = "System.Windows.Forms" />
</Imports>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.vb"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "loginform.vb"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "loginform.resx"
DependentUpon = "loginform.vb"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "LogMain.vb"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "LogMain.resx"
DependentUpon = "LogMain.vb"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "main.vb"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "main.resx"
DependentUpon = "main.vb"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "maincode.vb"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</VisualBasic>
</VisualStudioProject>

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" targetNamespace="" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="data">
<xsd:complexType>
<xsd:all>
<xsd:element name="value" minOccurs="0" type="xsd:string" />
</xsd:all>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:all>
<xsd:element name="value" minOccurs="0" type="xsd:string" />
</xsd:all>
<xsd:attribute name="name" use="required" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element ref="data" />
<xsd:element ref="resheader" />
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<data name="Timer1.Location" type="System.Drawing.Point, System.Drawing">
<value>17, 17</value>
</data>
<resheader name="ResMimeType">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="Version">
<value>1.0.0.0</value>
</resheader>
<resheader name="Reader">
<value>System.Resources.ResXResourceReader</value>
</resheader>
<resheader name="Writer">
<value>System.Resources.ResXResourceWriter</value>
</resheader>
</root>

View file

@ -0,0 +1,203 @@
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Threading
Imports System.Net.Sockets
Public Class Form1
Inherits System.Windows.Forms.Form
Private Listener As TcpListener
Private StopListener As Boolean
Private ActiveThreads As Integer
Private ThreadIndex As Integer
Public Sub New()
MyBase.New()
Form1 = Me
'This call is required by the Win Form Designer.
InitializeComponent()
Listener = New TcpListener(9105)
Listener.Start()
lstStatus.Items.Insert(lstStatus.Items.Count, "Listener Started")
Timer1.Enabled = True
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
#Region " Windows Form Designer generated code "
'Required by the Windows Form Designer
Private WithEvents Label1 As System.Windows.Forms.Label
Private WithEvents txtMaxThreads As System.Windows.Forms.TextBox
Private WithEvents lstStatus As System.Windows.Forms.ListBox
Private WithEvents Timer1 As System.Windows.Forms.Timer
Private WithEvents cmdStopListener As System.Windows.Forms.Button
Dim WithEvents Form1 As System.Windows.Forms.Form
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.lstStatus = New System.Windows.Forms.ListBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtMaxThreads = New System.Windows.Forms.TextBox()
Me.cmdStopListener = New System.Windows.Forms.Button()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.lstStatus.Location = New System.Drawing.Point(6, 42)
Me.lstStatus.Size = New System.Drawing.Size(414, 199)
Me.lstStatus.TabIndex = 4
Me.Label1.Location = New System.Drawing.Point(12, 12)
Me.Label1.Size = New System.Drawing.Size(72, 16)
Me.Label1.TabIndex = 6
Me.Label1.Text = "Max Threads:"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Label1.Visible = False
Me.txtMaxThreads.Location = New System.Drawing.Point(90, 12)
Me.txtMaxThreads.Size = New System.Drawing.Size(32, 20)
Me.txtMaxThreads.TabIndex = 5
Me.txtMaxThreads.Text = "5"
Me.txtMaxThreads.Visible = False
Me.cmdStopListener.Location = New System.Drawing.Point(324, 12)
Me.cmdStopListener.Size = New System.Drawing.Size(94, 24)
Me.cmdStopListener.TabIndex = 3
Me.cmdStopListener.Text = "Stop Listener"
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(432, 253)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label1, Me.txtMaxThreads, Me.lstStatus, Me.cmdStopListener})
Me.Text = "Listener"
End Sub
#End Region
Protected Sub sendmessage(ByVal sock As Socket, ByVal message As String)
Dim Buffer(1000) As Byte
Buffer = System.Text.Encoding.Default.GetBytes(message.ToCharArray & vbCrLf)
'Send the results back to the client application via the open socket and
'close the socket
sock.Send(Buffer, Buffer.Length, 0)
Console.WriteLine(message)
End Sub
Protected Sub processmessage(ByVal sock As Socket, ByVal message As String)
Dim Bytes As Integer
Dim Temp As String
Dim cmd() As String
cmd = message.Split
Select Case (cmd(0).ToUpper)
Case "LOGIN:"
Console.WriteLine("Username: " & cmd(1) & "Password: " & cmd(3))
sendmessage(sock, "LOGINOK")
End Select
End Sub
Protected Sub ProcessRequest()
Dim CurThread As Thread
Dim CurSocket As Socket
Dim Buffer(100) As Byte
Dim Bytes As Integer
Dim Temp As String
CurThread = System.Threading.Thread.CurrentThread()
CurSocket = Listener.AcceptSocket
While Not StopListener
If CurSocket.Available > 0 Then
Bytes = CurSocket.Receive(Buffer, Buffer.Length, 0)
Temp = System.Text.Encoding.Default.GetString(Buffer)
SyncLock CurThread
lstStatus.Items.Insert(lstStatus.Items.Count, System.Text.Encoding.Default.GetString(Buffer))
lstStatus.SelectedIndex = lstStatus.Items.Count - 1
processmessage(CurSocket, Temp)
End SyncLock
Exit While
End If
Application.DoEvents()
If Not CurSocket.Connected Then
StopListener = True
End If
End While
CurSocket.Close()
SyncLock CurThread
ActiveThreads -= 1
End SyncLock
End Sub
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim CurThreadStart As ThreadStart
Dim CurThread As Thread
Dim ThreadCount As Integer
Dim i As Integer
If Not Listener.Pending() Then
Exit Sub
End If
Timer1.Enabled = False
If ActiveThreads > CInt(txtMaxThreads.Text) Then
Timer1.Enabled = True
Exit Sub
End If
CurThreadStart = New ThreadStart(AddressOf ProcessRequest)
CurThread = New Thread(CurThreadStart)
CurThread.Start()
SyncLock CurThread
ActiveThreads += 1
End SyncLock
Timer1.Enabled = True
End Sub
Protected Sub cmdStopListener_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdStopListener.Click
StopListener = True
Timer1.Stop()
Listener.Stop()
End Sub
Public Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Form1.Closing
Timer1.Stop()
If Not Listener Is Nothing Then
Listener.Stop()
End If
End Sub
End Class

View file

@ -0,0 +1,107 @@
<VisualStudioProject>
<VisualBasic
ProjectType = "Local"
ProductVersion = "7.0.9466"
SchemaVersion = "1.0"
ProjectGuid = "{117DEB1E-D437-41D3-A81D-DCA1165CDEBD}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Listener"
AssemblyOriginatorKeyFile = ""
AssemblyOriginatorKeyMode = "None"
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "WinExe"
OptionCompare = "Binary"
OptionExplicit = "On"
OptionStrict = "Off"
RootNamespace = "Listener"
StartupObject = "Listener.Form1"
>
<Config
Name = "Debug"
BaseAddress = "0"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "true"
DefineTrace = "true"
DebugSymbols = "true"
IncrementalBuild = "true"
Optimize = "false"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
<Config
Name = "Release"
BaseAddress = "0"
ConfigurationOverrideFile = ""
DefineConstants = ""
DefineDebug = "false"
DefineTrace = "true"
DebugSymbols = "false"
IncrementalBuild = "true"
Optimize = "false"
OutputPath = "bin\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "1"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
/>
</References>
<Imports>
<Import Namespace = "Microsoft.VisualBasic" />
<Import Namespace = "System" />
<Import Namespace = "System.Collections" />
<Import Namespace = "System.Data" />
<Import Namespace = "System.Drawing" />
<Import Namespace = "System.Diagnostics" />
<Import Namespace = "System.Windows.Forms" />
</Imports>
</Build>
<Files>
<Include>
<File
RelPath = "Listener.vb"
SubType = "Form"
BuildAction = "Compile"
/>
<File
RelPath = "Listener.resx"
DependentUpon = "Listener.vb"
BuildAction = "EmbeddedResource"
/>
</Include>
</Files>
</VisualBasic>
</VisualStudioProject>

132
CLFClient/LogMain.resx Normal file
View file

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="TVHostlist.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="RTMessages.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="Messages.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="DateF.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="TimeF.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="HostF.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="FacF.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="SevF.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MsgF.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="StatusBar1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="$this.Name">
<value>LogMain</value>
</data>
</root>

339
CLFClient/LogMain.vb Normal file
View file

@ -0,0 +1,339 @@
Public Class LogMain
Inherits System.Windows.Forms.Form
Private hostarray As New ArrayList()
Private messagearray As New ArrayList()
Private myMessageSet As DataSet
Friend netcoms
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TVHostlist As System.Windows.Forms.TreeView
Friend WithEvents RTMessages As System.Windows.Forms.DataGrid
Friend WithEvents Messages As System.Windows.Forms.DataGridTableStyle
Friend WithEvents DateF As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents TimeF As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents HostF As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents SevF As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents FacF As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents MsgF As System.Windows.Forms.DataGridTextBoxColumn
Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TVHostlist = New System.Windows.Forms.TreeView()
Me.RTMessages = New System.Windows.Forms.DataGrid()
Me.Messages = New System.Windows.Forms.DataGridTableStyle()
Me.DateF = New System.Windows.Forms.DataGridTextBoxColumn()
Me.TimeF = New System.Windows.Forms.DataGridTextBoxColumn()
Me.HostF = New System.Windows.Forms.DataGridTextBoxColumn()
Me.FacF = New System.Windows.Forms.DataGridTextBoxColumn()
Me.SevF = New System.Windows.Forms.DataGridTextBoxColumn()
Me.MsgF = New System.Windows.Forms.DataGridTextBoxColumn()
Me.StatusBar1 = New System.Windows.Forms.StatusBar()
CType(Me.RTMessages, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TVHostlist
'
Me.TVHostlist.ImageIndex = -1
Me.TVHostlist.Name = "TVHostlist"
Me.TVHostlist.SelectedImageIndex = -1
Me.TVHostlist.Size = New System.Drawing.Size(128, 344)
Me.TVHostlist.TabIndex = 0
'
'RTMessages
'
Me.RTMessages.DataMember = ""
Me.RTMessages.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.RTMessages.Location = New System.Drawing.Point(136, 0)
Me.RTMessages.Name = "RTMessages"
Me.RTMessages.ReadOnly = True
Me.RTMessages.Size = New System.Drawing.Size(448, 312)
Me.RTMessages.TabIndex = 2
Me.RTMessages.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() {Me.Messages})
'
'Messages
'
Me.Messages.DataGrid = Me.RTMessages
Me.Messages.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.DateF, Me.TimeF, Me.HostF, Me.FacF, Me.SevF, Me.MsgF})
Me.Messages.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.Messages.MappingName = ""
Me.Messages.ReadOnly = True
'
'DateF
'
Me.DateF.Format = ""
Me.DateF.FormatInfo = Nothing
Me.DateF.HeaderText = "Date"
Me.DateF.MappingName = "Date"
Me.DateF.ReadOnly = True
Me.DateF.Width = 75
'
'TimeF
'
Me.TimeF.Format = ""
Me.TimeF.FormatInfo = Nothing
Me.TimeF.HeaderText = "Time"
Me.TimeF.MappingName = ""
Me.TimeF.ReadOnly = True
Me.TimeF.Width = 75
'
'HostF
'
Me.HostF.Format = ""
Me.HostF.FormatInfo = Nothing
Me.HostF.HeaderText = "Host"
Me.HostF.MappingName = "HostID"
Me.HostF.NullText = "<UNKNOWN>"
Me.HostF.ReadOnly = True
Me.HostF.Width = 75
'
'FacF
'
Me.FacF.Format = ""
Me.FacF.FormatInfo = Nothing
Me.FacF.HeaderText = "Facility"
Me.FacF.MappingName = "Fac"
Me.FacF.ReadOnly = True
Me.FacF.Width = 75
'
'SevF
'
Me.SevF.Format = ""
Me.SevF.FormatInfo = Nothing
Me.SevF.HeaderText = "Severity"
Me.SevF.MappingName = "Sev"
Me.SevF.ReadOnly = True
Me.SevF.Width = 75
'
'MsgF
'
Me.MsgF.Format = ""
Me.MsgF.FormatInfo = Nothing
Me.MsgF.HeaderText = "Message"
Me.MsgF.MappingName = "Message"
Me.MsgF.ReadOnly = True
Me.MsgF.Width = 75
'
'StatusBar1
'
Me.StatusBar1.Location = New System.Drawing.Point(0, 326)
Me.StatusBar1.Name = "StatusBar1"
Me.StatusBar1.Size = New System.Drawing.Size(592, 16)
Me.StatusBar1.TabIndex = 3
'
'LogMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(592, 342)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.StatusBar1, Me.TVHostlist, Me.RTMessages})
Me.Name = "LogMain"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "System Messages"
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
CType(Me.RTMessages, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub LogMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
RTMessages.Width = Me.Width - TVHostlist.Width
RTMessages.Height = Me.Height - StatusBar1.Height
TVHostlist.Height = Me.Height - StatusBar1.Height
End Sub
Private Sub CreateMyStatusBar()
' Create a StatusBar control.
' Create two StatusBarPanel objects to display in the StatusBar.
Dim panel1 As New StatusBarPanel()
Dim panel2 As New StatusBarPanel()
Dim panel3 As New StatusBarPanel()
' Display the first panel with a sunken border style.
panel1.BorderStyle = StatusBarPanelBorderStyle.Sunken
' Initialize the text of the panel.
panel1.Text = "Ready..."
' Set the AutoSize property to use all remaining space on the StatusBar.
'panel1.Width = 100
panel1.AutoSize = StatusBarPanelAutoSize.Spring
' Display the second panel with a raised border style.
panel2.BorderStyle = StatusBarPanelBorderStyle.Raised
' Create ToolTip text that displays the current time.
panel2.ToolTipText = System.DateTime.Now.ToShortTimeString()
' Set the text of the panel to the current date.
panel2.Text = System.DateTime.Today.ToLongDateString()
' Set the AutoSize property to size the panel to the size of the contents.
panel2.AutoSize = StatusBarPanelAutoSize.Contents
panel3.BorderStyle = StatusBarPanelBorderStyle.Sunken
panel3.Text = "0/0 Records Displayed"
panel3.AutoSize = StatusBarPanelAutoSize.Contents
StatusBar1.Panels.Add(panel1)
StatusBar1.Panels.Add(panel3)
StatusBar1.Panels.Add(panel2)
' Display panels in the StatusBar control.
StatusBar1.ShowPanels = True
' Add both panels to the StatusBarPanelCollection of the StatusBar.
End Sub
Private Sub LogMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
CreateMyStatusBar()
Dim x As Integer
For x = 0 To 20
hostarray.Add(New String("Host" + x.ToString()))
Next
For x = 0 To 30
messagearray.Add(New String("message" + x.ToString()))
Next
TVHostlist.BeginUpdate()
TVHostlist.Nodes.Clear()
Dim host As String
For Each host In hostarray
TVHostlist.Nodes.Add(New TreeNode(host))
Next
TVHostlist.EndUpdate()
Dim message As String
For Each message In messagearray
RTMessages.Text = message
Next
SetUp()
RTMessages.Update()
End Sub
Private Sub SetUp()
' Create a DataSet with two tables and one relation.
MakeDataSet()
' Bind the DataGrid to the DataSet. The dataMember
' specifies that the Customers table should be displayed.
RTMessages.SetDataBinding(myMessageSet, "Message")
End Sub
Private Sub RTMessages_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
' Create a HitTestInfo object using the HitTest method.
' Get the DataGrid by casting sender.
Dim myGrid As DataGrid = CType(sender, DataGrid)
Dim myHitInfo As DataGrid.HitTestInfo = RTMessages.HitTest(e.X, e.Y)
Console.WriteLine(myHitInfo)
Console.WriteLine(myHitInfo.Type)
Console.WriteLine(myHitInfo.Row)
Console.WriteLine(myHitInfo.Column)
End Sub
' Create a DataSet with two tables and populate it.
Private Sub MakeDataSet()
' Create a DataSet.
StatusBar1.Panels(0).Text = "Loading..."
myMessageSet = New DataSet("myMessages")
' Create two DataTables.
Dim thost As New DataTable("Hosts")
Dim tmessage As New DataTable("Message")
tmessage.Select()
' Create two columns, and add them to the first table.
Dim tHostID As New DataColumn("HostID", GetType(Integer))
Dim THostName As New DataColumn("HostName")
thost.Columns.Add(tHostID)
thost.Columns.Add(THostName)
' Create three columns, and add them to the second table.
Dim mID As New DataColumn("MsgID", GetType(Integer))
Dim mHostID As New DataColumn("HostID", GetType(Integer))
Dim mDate As New DataColumn("Date", GetType(DateTime))
Dim mSev As New DataColumn("Sev", GetType(Integer))
Dim mFac As New DataColumn("Fac", GetType(Integer))
Dim mMsg As New DataColumn("Message")
tmessage.Columns.Add(mID)
tmessage.Columns.Add(mHostID)
tmessage.Columns.Add(mDate)
tmessage.Columns.Add(mSev)
tmessage.Columns.Add(mFac)
tmessage.Columns.Add(mMsg)
' Add the tables to the DataSet.
myMessageSet.Tables.Add(thost)
myMessageSet.Tables.Add(tmessage)
' Create a DataRelation, and add it to the DataSet.
Dim dr As New DataRelation("msgtohost", tHostID, mHostID)
myMessageSet.Relations.Add(dr)
' Populates the tables. For each customer and order,
' creates two DataRow variables.
Dim newRow1 As DataRow
Dim newRow2 As DataRow
' Create three customers in the Customers Table.
Dim i As Integer
For i = 1 To 10
newRow1 = thost.NewRow()
newRow1("HostID") = i
newRow1("hostname") = "Host" + i.ToString
' Add the row to the Customers table.
thost.Rows.Add(newRow1)
Next i
Dim k As Integer
k = 1
' For each customer, create five rows in the Orders table.
For i = 1 To 10
Dim j As Integer
For j = 1 To 12
newRow2 = tmessage.NewRow()
newRow2("msgID") = k
newRow2("HostID") = i
newRow2("Date") = New DateTime(2001, i, j)
newRow2("sev") = 1
newRow2("fac") = 1
newRow2("message") = "This is the " + ((i * j).ToString) + " Message"
' Add the row to the Orders table.
tmessage.Rows.Add(newRow2)
k = k + 1
Next j
Next i
Dim y As Integer
y = tmessage.Rows.Count
StatusBar1.Panels(1).Text = (k - 1).ToString + "/" + y.ToString + " Records Displayed"
StatusBar1.Panels(0).Text = "Ready..."
End Sub
Private Sub StatusBar1_PanelClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.StatusBarPanelClickEventArgs) Handles StatusBar1.PanelClick
End Sub
End Class

126
CLFClient/loginform.resx Normal file
View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="Label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="TxtUsername.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="TxtPassword.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="BtnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="BtnLogin.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="cmbServer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="Label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="$this.Name">
<value>loginform</value>
</data>
</root>

150
CLFClient/loginform.vb Normal file
View file

@ -0,0 +1,150 @@
Public Class loginform
Inherits System.Windows.Forms.Form
Public Event checklogin(ByVal username As String, ByVal pass As String, ByVal hostname As String)
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TxtUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtPassword As System.Windows.Forms.TextBox
Friend WithEvents BtnCancel As System.Windows.Forms.Button
Friend WithEvents BtnLogin As System.Windows.Forms.Button
Friend WithEvents cmbServer As System.Windows.Forms.ComboBox
Friend WithEvents Label3 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.TxtUsername = New System.Windows.Forms.TextBox()
Me.TxtPassword = New System.Windows.Forms.TextBox()
Me.BtnCancel = New System.Windows.Forms.Button()
Me.BtnLogin = New System.Windows.Forms.Button()
Me.cmbServer = New System.Windows.Forms.ComboBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(64, 16)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Username:"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(16, 40)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(58, 15)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Password:"
'
'TxtUsername
'
Me.TxtUsername.Location = New System.Drawing.Point(88, 8)
Me.TxtUsername.Name = "TxtUsername"
Me.TxtUsername.Size = New System.Drawing.Size(152, 20)
Me.TxtUsername.TabIndex = 2
Me.TxtUsername.Text = ""
'
'TxtPassword
'
Me.TxtPassword.Location = New System.Drawing.Point(88, 32)
Me.TxtPassword.Name = "TxtPassword"
Me.TxtPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TxtPassword.Size = New System.Drawing.Size(152, 20)
Me.TxtPassword.TabIndex = 3
Me.TxtPassword.Text = ""
'
'BtnCancel
'
Me.BtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.BtnCancel.Location = New System.Drawing.Point(24, 80)
Me.BtnCancel.Name = "BtnCancel"
Me.BtnCancel.Size = New System.Drawing.Size(104, 24)
Me.BtnCancel.TabIndex = 4
Me.BtnCancel.Text = "&Cancel"
'
'BtnLogin
'
Me.BtnLogin.Location = New System.Drawing.Point(128, 80)
Me.BtnLogin.Name = "BtnLogin"
Me.BtnLogin.Size = New System.Drawing.Size(104, 24)
Me.BtnLogin.TabIndex = 5
Me.BtnLogin.Text = "&Login"
'
'cmbServer
'
Me.cmbServer.Location = New System.Drawing.Point(88, 56)
Me.cmbServer.Name = "cmbServer"
Me.cmbServer.Size = New System.Drawing.Size(152, 21)
Me.cmbServer.TabIndex = 6
Me.cmbServer.Text = "localhost"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(16, 64)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(58, 15)
Me.Label3.TabIndex = 7
Me.Label3.Text = "Server:"
'
'loginform
'
Me.AcceptButton = Me.BtnLogin
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.CancelButton = Me.BtnCancel
Me.ClientSize = New System.Drawing.Size(256, 108)
Me.ControlBox = False
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label3, Me.cmbServer, Me.BtnLogin, Me.BtnCancel, Me.TxtPassword, Me.TxtUsername, Me.Label2, Me.Label1})
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Me.Name = "loginform"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Login"
Me.TopMost = True
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub BtnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLogin.Click
If (Len(TxtUsername.Text) <= 0) Or (Len(TxtPassword.Text) <= 0) Then
MsgBox("Invalid Login Information", MsgBoxStyle.Critical, "Error")
Else
RaiseEvent checklogin(TxtUsername.Text, TxtPassword.Text, cmbServer.Text)
' process login credentials
End If
End Sub
Private Sub BtnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCancel.Click
Me.Visible = False
End Sub
End Class

126
CLFClient/main.resx Normal file
View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MainMenu1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</data>
<data name="MainMenu1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MenuItem1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MenuItem3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MenuItem4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MenuItem5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MenuItem6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="MenuItem2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Assembly</value>
</data>
<data name="$this.Name">
<value>MainForm</value>
</data>
</root>

139
CLFClient/main.vb Normal file
View file

@ -0,0 +1,139 @@
Public Class MainForm
Inherits System.Windows.Forms.Form
Dim WithEvents loginform As New loginform()
Dim WithEvents logwindow As New LogMain()
Dim WithEvents nc As New netcoms()
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.MainMenu1 = New System.Windows.Forms.MainMenu()
Me.MenuItem1 = New System.Windows.Forms.MenuItem()
Me.MenuItem3 = New System.Windows.Forms.MenuItem()
Me.MenuItem4 = New System.Windows.Forms.MenuItem()
Me.MenuItem5 = New System.Windows.Forms.MenuItem()
Me.MenuItem6 = New System.Windows.Forms.MenuItem()
Me.MenuItem2 = New System.Windows.Forms.MenuItem()
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem3, Me.MenuItem4, Me.MenuItem5, Me.MenuItem6})
Me.MenuItem1.Text = "&File"
'
'MenuItem3
'
Me.MenuItem3.Index = 0
Me.MenuItem3.Text = "&New Server"
'
'MenuItem4
'
Me.MenuItem4.Index = 1
Me.MenuItem4.Text = "&Close Server"
'
'MenuItem5
'
Me.MenuItem5.Index = 2
Me.MenuItem5.Text = "-"
'
'MenuItem6
'
Me.MenuItem6.Index = 3
Me.MenuItem6.Text = "E&xit"
'
'MenuItem2
'
Me.MenuItem2.Index = 1
Me.MenuItem2.MdiList = True
Me.MenuItem2.Text = "&Window"
'
'MainForm
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(600, 284)
Me.IsMdiContainer = True
Me.Menu = Me.MainMenu1
Me.Name = "MainForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "CLF Client"
End Sub
#End Region
Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
loginform.MdiParent = Me
loginform.Show()
MenuItem3.Enabled = False
MenuItem4.Enabled = False
End Sub
Public Sub startload() Handles nc.loginok
MenuItem3.Enabled = False
MenuItem4.Enabled = True
logwindow.MdiParent = Me
logwindow.Show()
loginform.Hide()
End Sub
Public Sub checklogin(ByVal user As String, ByVal pass As String, ByVal hostname As String) Handles loginform.checklogin
nc.connect(user, pass, hostname)
End Sub
Public Sub disconnected(ByVal reason As String) Handles nc.disconnected
MsgBox(reason, MsgBoxStyle.Critical, "Network Error")
End Sub
' exit
Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
Me.Close()
End Sub
' close server
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
MenuItem4.Enabled = False
MenuItem3.Enabled = True
logwindow.Close()
End Sub
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
loginform.Show()
MenuItem3.Enabled = False
MenuItem4.Enabled = False
End Sub
End Class

137
CLFClient/maincode.vb Normal file
View file

@ -0,0 +1,137 @@
Option Explicit On
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Threading
Imports System.Net.Sockets
Public Class netcoms
Private ActiveThreads As Thread
Private ActiveThreadsState As Integer
Private user As String
Private host As String
Private pass As String
Private connected As Boolean
Friend logmain
Public Event loginok()
Public Event disconnected(ByVal reason As String)
Public Sub New()
connected = False
End Sub
Public Property username() As String
Get
Return user
End Get
Set(ByVal Value As String)
user = Value
End Set
End Property
Public Property password() As String
Get
Return pass
End Get
Set(ByVal Value As String)
pass = Value
End Set
End Property
Public Property hostname() As String
Get
Return hostname
End Get
Set(ByVal Value As String)
host = Value
End Set
End Property
Public Sub connect(ByVal username As String, ByVal password As String, ByVal hostname As String)
Dim i As Integer
Dim ClientCount As Integer
Dim ActiveThreadStart As ThreadStart
user = username
pass = password
host = hostname
'Create a ThreadStart object, passing the address of NewThread
ActiveThreadStart = New ThreadStart(AddressOf startclient)
ActiveThreads = New Thread(ActiveThreadStart)
ActiveThreads.Name = "tcpclient"
ActiveThreads.Start()
ActiveThreadsState = System.Threading.ThreadState.Running
End Sub
Private Sub dowrite(ByVal client As TcpClient, ByVal message As String)
Dim Buffer() As Byte
Buffer = System.Text.Encoding.Default.GetBytes(message.ToCharArray)
client.GetStream().Write(Buffer, 0, Buffer.Length)
End Sub
Protected Sub processmessage(ByVal sock As TcpClient, ByVal message As String)
Dim Bytes As Integer
Dim Temp As String
Dim cmd() As String
Dim NewThread As Thread
NewThread = System.Threading.Thread.CurrentThread
cmd = message.Split
Select Case (cmd(0).ToUpper)
Case "LOGINOK"
Console.WriteLine("Login was ok" & vbCrLf)
SyncLock NewThread
RaiseEvent loginok()
End SyncLock
End Select
End Sub
Sub startclient()
Dim NewThread As Thread
Dim ThreadName As String
Dim Client As TcpClient
Dim InBuff(100) As Byte
Dim Temp As String
NewThread = System.Threading.Thread.CurrentThread
ThreadName = NewThread.Name
Client = New TcpClient()
Try
Client.Connect(host, 9105)
Catch e As Exception
SyncLock NewThread
Console.WriteLine("Connection to server failed with return code: " & e.Message)
End SyncLock
RaiseEvent disconnected(e.Message)
Exit Sub
End Try
dowrite(Client, "Login: " & user & " Pass " & pass)
While True
While Not Client.GetStream.DataAvailable()
Application.DoEvents()
End While
If Client.GetStream.DataAvailable() Then
Client.GetStream().Read(InBuff, 0, InBuff.Length)
Temp = System.Text.Encoding.Default.GetString(InBuff)
SyncLock NewThread
Console.WriteLine(Temp & vbCrLf)
End SyncLock
processmessage(Client, Temp)
End If
End While
Client.Close()
RaiseEvent disconnected("ended")
ActiveThreads.Abort()
End Sub
End Class