ThinClient TeamViewer

This commit is contained in:
ms
2019-12-05 08:39:46 +01:00
parent 8e7fc09e45
commit 5f24e2a9e1
8 changed files with 109 additions and 28 deletions

View File

@@ -35,7 +35,7 @@ Public Class Class1
End Sub End Sub
Public Shared Function CheckDebug() Public Shared Function CheckDebug()
Dim Debugoverride As Boolean = False 'wenn True dann Override auf Produktiv! Dim Debugoverride As Boolean = True 'wenn True dann Override auf Produktiv!
Dim Startparameter As String = "" Dim Startparameter As String = ""
Dim i As Integer Dim i As Integer
For Each s As String In Environment.GetCommandLineArgs For Each s As String In Environment.GetCommandLineArgs

View File

@@ -45,8 +45,10 @@
Public Shared Function pingip(ip As String, Optional ByVal Argument As String = "") Public Shared Function pingip(ip As String, Optional ByVal Argument As String = "")
Dim ping As New Process Dim ping As New Process
ping.StartInfo.FileName = "cmd.exe" 'ping.StartInfo.FileName = "cmd.exe"
ping.StartInfo.Arguments = " /k ping " & ip & Argument 'ping.StartInfo.Arguments = " /k ping " & ip & Argument
ping.StartInfo.FileName = "powershell.exe"
ping.StartInfo.Arguments = " /noexit /c ping " & ip & Argument
ping.Start() ping.Start()
End Function End Function

View File

@@ -81,6 +81,8 @@ Public Class cHost
list.Add(New SQLVariable("DHCP", DHCP)) list.Add(New SQLVariable("DHCP", DHCP))
'list.Add(New SQLVariable("Netzwerk", Netzwerk)) 'list.Add(New SQLVariable("Netzwerk", Netzwerk))
list.Add(New SQLVariable("Firewall", Firewall)) list.Add(New SQLVariable("Firewall", Firewall))
list.Add(New SQLVariable("TeamviewerID", TeamviewerID))
list.Add(New SQLVariable("TeamviewerKennwort", TeamviewerKennwort))
Return list Return list
End Function End Function

View File

@@ -618,7 +618,7 @@ Public Class Main
End Function End Function
Private Sub CmdTest_Click(sender As Object, e As EventArgs) Handles CmdTest.Click Private Sub CmdTest_Click(sender As Object, e As EventArgs) Handles CmdTest.Click
cFolder.netdelete("10.4.3.17") 'cFolder.netdelete("10.4.3.17")
End Sub End Sub

View File

@@ -199,7 +199,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die 0.0.1.42 ähnelt. ''' Sucht eine lokalisierte Zeichenfolge, die 0.0.1.44 ähnelt.
'''</summary> '''</summary>
Friend ReadOnly Property Version() As String Friend ReadOnly Property Version() As String
Get Get

View File

@@ -128,7 +128,7 @@
<value>..\Resources\Bearbeiten20.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Bearbeiten20.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="Version" xml:space="preserve"> <data name="Version" xml:space="preserve">
<value>0.0.1.42</value> <value>0.0.1.44</value>
</data> </data>
<data name="Print20x20" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Print20x20" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Print20x20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Print20x20.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

View File

@@ -35,6 +35,8 @@ Partial Class uscntr_TSSitzungen
Me.chkAutoUpdate = New System.Windows.Forms.CheckBox() Me.chkAutoUpdate = New System.Windows.Forms.CheckBox()
Me.CmdUpdate = New System.Windows.Forms.Button() Me.CmdUpdate = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel() Me.Panel2 = New System.Windows.Forms.Panel()
Me.btnClient = New System.Windows.Forms.Button()
Me.btnSitzung = New System.Windows.Forms.Button()
Me.btnReset = New System.Windows.Forms.Button() Me.btnReset = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label()
Me.TextBox1 = New System.Windows.Forms.TextBox() Me.TextBox1 = New System.Windows.Forms.TextBox()
@@ -53,13 +55,13 @@ Partial Class uscntr_TSSitzungen
Me.dgvTSSitzungen.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvTSSitzungen.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvTSSitzungen.ContextMenuStrip = Me.ContextMenuStrip1 Me.dgvTSSitzungen.ContextMenuStrip = Me.ContextMenuStrip1
Me.dgvTSSitzungen.Dock = System.Windows.Forms.DockStyle.Fill Me.dgvTSSitzungen.Dock = System.Windows.Forms.DockStyle.Fill
Me.dgvTSSitzungen.Location = New System.Drawing.Point(0, 36) Me.dgvTSSitzungen.Location = New System.Drawing.Point(0, 58)
Me.dgvTSSitzungen.MultiSelect = False Me.dgvTSSitzungen.MultiSelect = False
Me.dgvTSSitzungen.Name = "dgvTSSitzungen" Me.dgvTSSitzungen.Name = "dgvTSSitzungen"
Me.dgvTSSitzungen.ReadOnly = True Me.dgvTSSitzungen.ReadOnly = True
Me.dgvTSSitzungen.RowTemplate.ReadOnly = True Me.dgvTSSitzungen.RowTemplate.ReadOnly = True
Me.dgvTSSitzungen.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.dgvTSSitzungen.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.dgvTSSitzungen.Size = New System.Drawing.Size(365, 197) Me.dgvTSSitzungen.Size = New System.Drawing.Size(365, 175)
Me.dgvTSSitzungen.TabIndex = 0 Me.dgvTSSitzungen.TabIndex = 0
' '
'ContextMenuStrip1 'ContextMenuStrip1
@@ -161,15 +163,47 @@ Partial Class uscntr_TSSitzungen
'Panel2 'Panel2
' '
Me.Panel2.BackColor = System.Drawing.SystemColors.GradientInactiveCaption Me.Panel2.BackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.Panel2.Controls.Add(Me.btnClient)
Me.Panel2.Controls.Add(Me.btnSitzung)
Me.Panel2.Controls.Add(Me.btnReset) Me.Panel2.Controls.Add(Me.btnReset)
Me.Panel2.Controls.Add(Me.Label1) Me.Panel2.Controls.Add(Me.Label1)
Me.Panel2.Controls.Add(Me.TextBox1) Me.Panel2.Controls.Add(Me.TextBox1)
Me.Panel2.Dock = System.Windows.Forms.DockStyle.Top Me.Panel2.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel2.Location = New System.Drawing.Point(0, 0) Me.Panel2.Location = New System.Drawing.Point(0, 0)
Me.Panel2.Name = "Panel2" Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(365, 36) Me.Panel2.Size = New System.Drawing.Size(365, 58)
Me.Panel2.TabIndex = 3 Me.Panel2.TabIndex = 3
' '
'btnClient
'
Me.btnClient.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnClient.BackColor = System.Drawing.Color.DarkGray
Me.btnClient.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.btnClient.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnClient.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnClient.Location = New System.Drawing.Point(182, 30)
Me.btnClient.Margin = New System.Windows.Forms.Padding(8)
Me.btnClient.Name = "btnClient"
Me.btnClient.Size = New System.Drawing.Size(79, 20)
Me.btnClient.TabIndex = 15
Me.btnClient.Text = "Client"
Me.btnClient.UseVisualStyleBackColor = False
'
'btnSitzung
'
Me.btnSitzung.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSitzung.BackColor = System.Drawing.Color.Green
Me.btnSitzung.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.btnSitzung.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnSitzung.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnSitzung.Location = New System.Drawing.Point(103, 30)
Me.btnSitzung.Margin = New System.Windows.Forms.Padding(8)
Me.btnSitzung.Name = "btnSitzung"
Me.btnSitzung.Size = New System.Drawing.Size(79, 20)
Me.btnSitzung.TabIndex = 14
Me.btnSitzung.Text = "Sitzungen"
Me.btnSitzung.UseVisualStyleBackColor = False
'
'btnReset 'btnReset
' '
Me.btnReset.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnReset.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -177,7 +211,7 @@ Partial Class uscntr_TSSitzungen
Me.btnReset.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) Me.btnReset.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnReset.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnReset.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnReset.Location = New System.Drawing.Point(276, 8) Me.btnReset.Location = New System.Drawing.Point(276, 9)
Me.btnReset.Margin = New System.Windows.Forms.Padding(8) Me.btnReset.Margin = New System.Windows.Forms.Padding(8)
Me.btnReset.Name = "btnReset" Me.btnReset.Name = "btnReset"
Me.btnReset.Size = New System.Drawing.Size(81, 20) Me.btnReset.Size = New System.Drawing.Size(81, 20)
@@ -201,7 +235,7 @@ Partial Class uscntr_TSSitzungen
Me.TextBox1.Location = New System.Drawing.Point(103, 8) Me.TextBox1.Location = New System.Drawing.Point(103, 8)
Me.TextBox1.Margin = New System.Windows.Forms.Padding(8) Me.TextBox1.Margin = New System.Windows.Forms.Padding(8)
Me.TextBox1.Name = "TextBox1" Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(157, 20) Me.TextBox1.Size = New System.Drawing.Size(158, 20)
Me.TextBox1.TabIndex = 0 Me.TextBox1.TabIndex = 0
' '
'uscntr_TSSitzungen 'uscntr_TSSitzungen
@@ -241,4 +275,6 @@ Partial Class uscntr_TSSitzungen
Friend WithEvents btnReset As Button Friend WithEvents btnReset As Button
Friend WithEvents lblAnzahl As Label Friend WithEvents lblAnzahl As Label
Friend WithEvents VerbindenMitTeamVToolStripMenuItem As ToolStripMenuItem Friend WithEvents VerbindenMitTeamVToolStripMenuItem As ToolStripMenuItem
Friend WithEvents btnClient As Button
Friend WithEvents btnSitzung As Button
End Class End Class

View File

@@ -1,29 +1,57 @@
Public Class uscntr_TSSitzungen Public Class uscntr_TSSitzungen
Dim Client As Boolean = False
Private Sub uscntr_TSSitzungen_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub uscntr_TSSitzungen_Load(sender As Object, e As EventArgs) Handles Me.Load
Class1.EnableDoubleBuffered(dgvTSSitzungen) Class1.EnableDoubleBuffered(dgvTSSitzungen)
Load2DGV() Load2DGV()
End Sub End Sub
Function Load2DGV(Optional ByVal WhereString As String = "") Function Load2DGV() ' (Optional ByVal Client As Boolean = False)
Dim ds As New DataSet If Client = False Then
cSQL.SQL2DS("SELECT * FROM TbL_TSSitzungen WHERE Name LIKE '" & ReturnOfTheWhere() & "' OR TSServer LIKE '" & ReturnOfTheWhere() & "' ORDER BY NAME", ds) Dim ds As New DataSet
cSQL.SQL2DS("SELECT * FROM TbL_TSSitzungen WHERE Name LIKE '" & ReturnOfTheWhere() & "' OR TSServer LIKE '" & ReturnOfTheWhere() & "' ORDER BY NAME", ds)
With dgvTSSitzungen
.RowHeadersVisible = False
.DataSource = ds.Tables(0)
.Columns("Domain").Visible = False
.Columns("LastLogon").Visible = False
.Columns("BenutzerAnmeldeName").Visible = False
.Columns("Name").Width = 110 'AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Columns("TeamviewerID").Width = 80
.Columns("TSServer").Width = 55
.AutoResizeColumn(1)
End With
lblAnzahl.Text = dgvTSSitzungen.Rows.Count
LoadTSServer()
Else
Dim ds As New DataSet
'cSQL.SQLCommand("DELETE FROM TbL_ThinClients where LastReport < (dateadd(HOUR, -1, getdate()))")
cSQL.SQL2DS("SELECT * FROM TbL_ThinClients WHERE Name LIKE '" & ReturnOfTheWhere() & "' OR ClientName LIKE '" & ReturnOfTheWhere() & "' ORDER BY NAME", ds)
With dgvTSSitzungen
.RowHeadersVisible = False
.DataSource = ds.Tables(0)
'.Columns("Domain").Visible = False
'.Columns("LastLogon").Visible = False
'.Columns("BenutzerAnmeldeName").Visible = False
'.Columns("Name").Width = 110 'AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
'.Columns("TeamviewerID").Width = 80
'.Columns("TSServer").Width = 55
.AutoResizeColumn(1)
End With
lblAnzahl.Text = dgvTSSitzungen.Rows.Count
End If
With dgvTSSitzungen
.RowHeadersVisible = False
.DataSource = ds.Tables(0)
.Columns("Domain").Visible = False
.Columns("LastLogon").Visible = False
.Columns("BenutzerAnmeldeName").Visible = False
.Columns("Name").Width = 110 'AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Columns("TeamviewerID").Width = 80
.Columns("TSServer").Width = 55
.AutoResizeColumn(1)
End With
lblAnzahl.Text = dgvTSSitzungen.Rows.Count
LoadTSServer()
End Function End Function
Private Sub dgvTSSitzungen_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvTSSitzungen.CellDoubleClick 'dgvTSSitzungen.CellContentDoubleClick, Private Sub dgvTSSitzungen_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvTSSitzungen.CellDoubleClick 'dgvTSSitzungen.CellContentDoubleClick,
@@ -85,7 +113,7 @@
End Sub End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Load2DGV(TextBox1.Text) Load2DGV() '(TextBox1.Text)
End Sub End Sub
Function ReturnOfTheWhere() Function ReturnOfTheWhere()
@@ -101,4 +129,17 @@
Dim sitzung As String = Class1.DBNull2emptyString(dgvTSSitzungen.CurrentRow.Cells("TeamviewerID").Value) Dim sitzung As String = Class1.DBNull2emptyString(dgvTSSitzungen.CurrentRow.Cells("TeamviewerID").Value)
Ext_Programme.StartTeamviewer(sitzung) Ext_Programme.StartTeamviewer(sitzung)
End Sub End Sub
Private Sub btnClick(sender As Object, e As EventArgs) Handles btnSitzung.Click, btnClient.Click
Select Case sender.name
Case "btnSitzung"
btnSitzung.BackColor = Color.Green : btnClient.BackColor = Color.DarkGray
Client = False
Case "btnClient"
btnClient.BackColor = Color.Red : btnSitzung.BackColor = Color.DarkGray
Client = True
End Select
cmdNachricht.Enabled = Not Client
Load2DGV()
End Sub
End Class End Class