Anydesk Integration C:\Verag

This commit is contained in:
ms
2024-11-06 11:10:40 +01:00
parent 8bc2fbf873
commit 6d7cf5b4e2
8 changed files with 211 additions and 61 deletions

View File

@@ -33,10 +33,14 @@ Partial Class Main
Me.TimerReport = New System.Windows.Forms.Timer(Me.components) Me.TimerReport = New System.Windows.Forms.Timer(Me.components)
Me.TelAnmelden = New System.Windows.Forms.Button() Me.TelAnmelden = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label() Me.Label1 = New System.Windows.Forms.Label()
Me.chkdebug = New System.Windows.Forms.CheckBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.btnShowAnydesk = New System.Windows.Forms.Button()
Me.SuspendLayout() Me.SuspendLayout()
' '
'btnLogOFF 'btnLogOFF
' '
Me.btnLogOFF.BackColor = System.Drawing.Color.IndianRed
Me.btnLogOFF.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnLogOFF.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnLogOFF.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnLogOFF.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnLogOFF.ImageAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnLogOFF.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
@@ -45,10 +49,11 @@ Partial Class Main
Me.btnLogOFF.Size = New System.Drawing.Size(184, 28) Me.btnLogOFF.Size = New System.Drawing.Size(184, 28)
Me.btnLogOFF.TabIndex = 28 Me.btnLogOFF.TabIndex = 28
Me.btnLogOFF.Text = "Abmelden" Me.btnLogOFF.Text = "Abmelden"
Me.btnLogOFF.UseVisualStyleBackColor = True Me.btnLogOFF.UseVisualStyleBackColor = False
' '
'btnResetSession 'btnResetSession
' '
Me.btnResetSession.BackColor = System.Drawing.Color.YellowGreen
Me.btnResetSession.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnResetSession.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnResetSession.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnResetSession.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnResetSession.ImageAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnResetSession.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
@@ -57,7 +62,7 @@ Partial Class Main
Me.btnResetSession.Size = New System.Drawing.Size(184, 28) Me.btnResetSession.Size = New System.Drawing.Size(184, 28)
Me.btnResetSession.TabIndex = 29 Me.btnResetSession.TabIndex = 29
Me.btnResetSession.Text = "Sitzung (neu) starten" Me.btnResetSession.Text = "Sitzung (neu) starten"
Me.btnResetSession.UseVisualStyleBackColor = True Me.btnResetSession.UseVisualStyleBackColor = False
' '
'Timer1 'Timer1
' '
@@ -65,6 +70,7 @@ Partial Class Main
' '
'btnShutdown 'btnShutdown
' '
Me.btnShutdown.BackColor = System.Drawing.Color.Red
Me.btnShutdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnShutdown.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnShutdown.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnShutdown.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnShutdown.ImageAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnShutdown.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
@@ -73,12 +79,12 @@ Partial Class Main
Me.btnShutdown.Size = New System.Drawing.Size(184, 28) Me.btnShutdown.Size = New System.Drawing.Size(184, 28)
Me.btnShutdown.TabIndex = 31 Me.btnShutdown.TabIndex = 31
Me.btnShutdown.Text = "Ausschalten" Me.btnShutdown.Text = "Ausschalten"
Me.btnShutdown.UseVisualStyleBackColor = True Me.btnShutdown.UseVisualStyleBackColor = False
' '
'cboxStandort 'cboxStandort
' '
Me.cboxStandort.FormattingEnabled = True Me.cboxStandort.FormattingEnabled = True
Me.cboxStandort.Items.AddRange(New Object() {"VERAG SUB (rdpintern.verag.ag)", "VERAG SBG (terminalsbg.verag.ag)", "BACKUP", "Personalisiert"}) Me.cboxStandort.Items.AddRange(New Object() {"VERAG SUB (rdpintern.verag.ag)", "Personalisiert"})
Me.cboxStandort.Location = New System.Drawing.Point(12, 80) Me.cboxStandort.Location = New System.Drawing.Point(12, 80)
Me.cboxStandort.Name = "cboxStandort" Me.cboxStandort.Name = "cboxStandort"
Me.cboxStandort.Size = New System.Drawing.Size(183, 21) Me.cboxStandort.Size = New System.Drawing.Size(183, 21)
@@ -94,6 +100,7 @@ Partial Class Main
' '
'TelAnmelden 'TelAnmelden
' '
Me.TelAnmelden.BackColor = System.Drawing.SystemColors.ActiveCaption
Me.TelAnmelden.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.TelAnmelden.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.TelAnmelden.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TelAnmelden.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TelAnmelden.ImageAlign = System.Drawing.ContentAlignment.MiddleRight Me.TelAnmelden.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
@@ -102,24 +109,60 @@ Partial Class Main
Me.TelAnmelden.Size = New System.Drawing.Size(184, 28) Me.TelAnmelden.Size = New System.Drawing.Size(184, 28)
Me.TelAnmelden.TabIndex = 34 Me.TelAnmelden.TabIndex = 34
Me.TelAnmelden.Text = "Telefon neu anmelden" Me.TelAnmelden.Text = "Telefon neu anmelden"
Me.TelAnmelden.UseVisualStyleBackColor = True Me.TelAnmelden.UseVisualStyleBackColor = False
' '
'Label1 'Label1
' '
Me.Label1.AutoSize = True Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(13, 183) Me.Label1.Location = New System.Drawing.Point(9, 246)
Me.Label1.Name = "Label1" Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(39, 13) Me.Label1.Size = New System.Drawing.Size(39, 13)
Me.Label1.TabIndex = 35 Me.Label1.TabIndex = 35
Me.Label1.Text = "Label1" Me.Label1.Text = "Label1"
' '
'chkdebug
'
Me.chkdebug.AutoSize = True
Me.chkdebug.Location = New System.Drawing.Point(11, 262)
Me.chkdebug.Name = "chkdebug"
Me.chkdebug.Size = New System.Drawing.Size(58, 17)
Me.chkdebug.TabIndex = 36
Me.chkdebug.Text = "Debug"
Me.chkdebug.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.BackColor = System.Drawing.SystemColors.Control
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Button1.Location = New System.Drawing.Point(11, 182)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(184, 28)
Me.Button1.TabIndex = 37
Me.Button1.Text = "Update"
Me.Button1.UseVisualStyleBackColor = False
'
'btnShowAnydesk
'
Me.btnShowAnydesk.Location = New System.Drawing.Point(107, 236)
Me.btnShowAnydesk.Name = "btnShowAnydesk"
Me.btnShowAnydesk.Size = New System.Drawing.Size(75, 23)
Me.btnShowAnydesk.TabIndex = 38
Me.btnShowAnydesk.Text = "Button2"
Me.btnShowAnydesk.UseVisualStyleBackColor = True
Me.btnShowAnydesk.Visible = False
'
'Main 'Main
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.ControlLightLight Me.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.ClientSize = New System.Drawing.Size(208, 214) Me.ClientSize = New System.Drawing.Size(208, 291)
Me.ControlBox = False Me.ControlBox = False
Me.Controls.Add(Me.btnShowAnydesk)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.chkdebug)
Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.TelAnmelden) Me.Controls.Add(Me.TelAnmelden)
Me.Controls.Add(Me.cboxStandort) Me.Controls.Add(Me.cboxStandort)
@@ -127,7 +170,7 @@ Partial Class Main
Me.Controls.Add(Me.btnResetSession) Me.Controls.Add(Me.btnResetSession)
Me.Controls.Add(Me.btnLogOFF) Me.Controls.Add(Me.btnLogOFF)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximumSize = New System.Drawing.Size(224, 300) Me.MaximumSize = New System.Drawing.Size(224, 330)
Me.MinimizeBox = False Me.MinimizeBox = False
Me.MinimumSize = New System.Drawing.Size(224, 230) Me.MinimumSize = New System.Drawing.Size(224, 230)
Me.Name = "Main" Me.Name = "Main"
@@ -147,4 +190,7 @@ Partial Class Main
Friend WithEvents TimerReport As Timer Friend WithEvents TimerReport As Timer
Friend WithEvents TelAnmelden As Button Friend WithEvents TelAnmelden As Button
Friend WithEvents Label1 As Label Friend WithEvents Label1 As Label
Friend WithEvents chkdebug As CheckBox
Friend WithEvents Button1 As Button
Friend WithEvents btnShowAnydesk As Button
End Class End Class

View File

@@ -15,6 +15,7 @@ Public Class Main
Public ConType As String Public ConType As String
Public MAC As String Public MAC As String
Public ClientMode As Boolean Public ClientMode As Boolean
Public Seriennummer As String = ""
Dim lastupdate As DateTime Dim lastupdate As DateTime
@@ -27,25 +28,27 @@ Public Class Main
WoBinIch() WoBinIch()
mstsc.EnableRaisingEvents = True mstsc.EnableRaisingEvents = True
Try 'Try
Dim GroupList As List(Of String) = cRes.GetUserGroupMembership(Environment.UserName, LDAP) ' Dim GroupList As List(Of String) = cRes.GetUserGroupMembership(Environment.UserName, LDAP)
For Each group As String In GroupList ' For Each group As String In GroupList
If group = "CN=SG_DEBUG" Then ' If group = "CN=SG_DEBUG" Then
debug = True ' debug = True
Timer2.Enabled = True ' Timer2.Enabled = True
End If ' End If
Next ' Next
Catch ex As Exception 'Catch ex As Exception
End Try 'End Try
Dim i As Integer Dim i As Integer
For Each s As String In Environment.GetCommandLineArgs For Each s As String In Environment.GetCommandLineArgs
If i > 0 Then If i > 0 Then
If s = "/d" Or s = "-d" Then If s = "/d" Or s = "-d" Then
debug = True
autoconnect = False autoconnect = False
autologoff = False autologoff = False
cRes.LocalUser.FillWithLoggedOnUser(False) : Report() : TimerReport.Enabled = True cRes.LocalUser.FillWithLoggedOnUser(False)
'Report() : TimerReport.Enabled = True
ElseIf s = "/c" Or s = "-c" Then ElseIf s = "/c" Or s = "-c" Then
autoconnect = False autoconnect = False
autologoff = False autologoff = False
@@ -70,13 +73,24 @@ Public Class Main
Timer1.Enabled = autoconnect Timer1.Enabled = autoconnect
'cRes.LocalUser.FillWithLoggedOnUser(False) 'cRes.LocalUser.FillWithLoggedOnUser(False)
cRes.LocalTeamviewerID = getTeamViewerID()
' Report()
Dim meh As New cPascom If Not debug Then
meh.Anmelden() cRes.LocalTeamviewerID = getTeamViewerID()
Seriennummer = cRes.getserialnumber()
MAC = cRes.getMacAddress()
Report()
CallmeHome()
Dim meh As New cPascom
meh.Anmelden()
Else
MsgBox("DebugMode")
End If
chkdebug.Checked = debug
If ClientMode = True Then btnResetSession.PerformClick() If ClientMode = True Then btnResetSession.PerformClick()
@@ -85,21 +99,50 @@ Public Class Main
Public Function Report() Public Function Report()
lastupdate = Date.Now lastupdate = Date.Now
Try
Dim ds As New DataSet Dim ds As New DataSet
cSQL.SQL2DS("select * from TbL_ThinClients where Benutzeranmeldename = '" & cRes.LocalUser.BenutzeranmeldeName & " ' ", ds) cSQL.SQL2DS("select * from TbL_ThinClients where Benutzeranmeldename = '" & cRes.LocalUser.BenutzeranmeldeName & " ' ", ds)
If Not ds.Tables(0).Rows.Count = 0 Then If Not ds.Tables(0).Rows.Count = 0 Then
RemoveSitzung() RemoveSitzung()
End If End If
cSQL.InsertSQL("TbL_ThinClients", "(Benutzeranmeldename, Name, TeamviewerID, LastReport, ClientName, Domain, Company, SystemUpTime) VALUES ( cSQL.InsertSQL("TbL_ThinClients", "(Benutzeranmeldename, Name, TeamviewerID, LastReport, ClientName, Domain, Company, AnydeskID, SystemUpTime) VALUES (
'" & cRes.LocalUser.BenutzeranmeldeName & "', '" & cRes.LocalUser.BenutzeranmeldeName & "',
'" & cRes.LocalUser.Name & "', '" & cRes.LocalUser.Name & "',
'" & cRes.LocalTeamviewerID & "', '" & cRes.LocalTeamviewerID & "',
'" & Date.Now & "', '" & Date.Now.ToString & "',
'" & cRes.LocalUser.Hostname & "', '" & cRes.LocalUser.Hostname & "',
'" & cRes.LocalUser.Domäne & "', '" & cRes.LocalUser.Domäne & "',
'" & cRes.LocalUser.Company & "', '" & cRes.LocalUser.Company & "',
'" & GetAnyDeskID() & "',
'" & cRes.getuptime(True) & "')") '" & cRes.getuptime(True) & "')")
Catch ex As Exception
If debug = True Then
MsgBox(ex.Message)
End If
End Try
End Function
Public Function CallmeHome()
Try
Dim ds As New DataSet
cSQL.SQL2DS("select * from TbL_ThinClientHosts where Seriennummer = '" & Seriennummer & " ' ", ds)
If Not ds.Tables(0).Rows.Count = 0 Then
'Update
cSQL.UpdateSQL("TbL_ThinClientHosts", "Hostname = '" & cRes.LocalUser.Hostname & "', TeamviewerID = '" & cRes.LocalTeamviewerID & "', Domain = '" & cRes.LocalUser.Domäne & "', LastUser = '" & cRes.LocalUser.BenutzeranmeldeName & "', MAC = '" & MAC & "'", "Seriennummer = '" & Seriennummer & " ' ")
Else
'Erstellen
cSQL.InsertSQL("TbL_ThinClientHosts", "(Hostname, Seriennummer, TeamviewerID, Domain, LastUser, MAC) VALUES (
'" & cRes.LocalUser.Hostname & "',
'" & Seriennummer & "',
'" & cRes.LocalTeamviewerID & "',
'" & cRes.LocalUser.Domäne & "',
'" & cRes.LocalUser.BenutzeranmeldeName & "',
'" & MAC & "')")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function End Function
Sub RemoveSitzung() Sub RemoveSitzung()
@@ -116,11 +159,6 @@ Public Class Main
LDAP = "LDAP://DC=VERAG,DC=OST,DC=DMN" LDAP = "LDAP://DC=VERAG,DC=OST,DC=DMN"
autoconnect = True autoconnect = True
autologoff = True autologoff = True
Case "VERAG-SBG"
cboxStandort.SelectedItem = "VERAG SBG (terminalsbg.verag.ag)"
LDAP = "LDAP://DC=VERAG-SBG,DC=LOCAL"
autoconnect = True
autologoff = True
Case "IMEX" Case "IMEX"
cboxStandort.SelectedItem = "VERAG SUB (rdpintern.verag.ag)" cboxStandort.SelectedItem = "VERAG SUB (rdpintern.verag.ag)"
LDAP = "LDAP://DC=IMEX,DC=LOCAL" LDAP = "LDAP://DC=IMEX,DC=LOCAL"
@@ -151,11 +189,14 @@ Public Class Main
Me.ControlBox = True Me.ControlBox = True
End If End If
If Not LoadParameters(Environment.UserName, ConType, ConString) = False Then If Not debug Then
cboxStandort.SelectedItem = "Personalisiert" If Not LoadParameters(Environment.UserName, ConType, ConString) = False Then
'ConString = LoadParameters(Environment.UserName) cboxStandort.SelectedItem = "Personalisiert"
'ConString = LoadParameters(Environment.UserName)
End If
End If End If
'Select Case Environment.UserName 'Select Case Environment.UserName
' Case "miesenbeck" ' Case "miesenbeck"
' cboxStandort.SelectedItem = "Personalisiert" ' cboxStandort.SelectedItem = "Personalisiert"
@@ -279,7 +320,10 @@ Public Class Main
End Sub End Sub
Private Sub Main_Closed(sender As Object, e As EventArgs) Handles Me.Closed Private Sub Main_Closed(sender As Object, e As EventArgs) Handles Me.Closed
LogOff() If debug = False Then
LogOff()
End If
End Sub End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
@@ -288,7 +332,7 @@ Public Class Main
Public Sub LogOff() Public Sub LogOff()
RemoveSitzung() RemoveSitzung()
If sAppPath Like "*\bin\Debug" Or Environment.UserName = "miesenbeck" Or Environment.UserName = "Administrator" Or autologoff = False Then If sAppPath Like "*\bin\Debug" Or Environment.UserName = "miesenbeck" Or Environment.UserName = "Administrator" Or autologoff = False Or debug = True Then
Me.ControlBox = True Me.ControlBox = True
Else Else
Try Try
@@ -317,7 +361,7 @@ Public Class Main
Public Function LoadParameters(ByVal Benutzername As String, ByRef _ConType As String, ByRef _ConString As String) Public Function LoadParameters(ByVal Benutzername As String, ByRef _ConType As String, ByRef _ConString As String)
Try Try
Dim lines = IO.File.ReadAllLines("\\dc01.verag.ost.dmn\NETLOGON\TSAnmeldung.ini") Dim lines = IO.File.ReadAllLines("\\verag.ost.dmn\NETLOGON\TSAnmeldung.ini")
Dim colCount = lines.First.Split(";"c).Length Dim colCount = lines.First.Split(";"c).Length
For Each line In lines For Each line In lines
@@ -355,6 +399,14 @@ Public Class Main
'End If 'End If
End Sub End Sub
Private Sub chkdebug_CheckedChanged(sender As Object, e As EventArgs) Handles chkdebug.CheckedChanged
debug = chkdebug.Checked
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Process.Start("C:\Verag\ROBO_2_C_Verag.bat")
'CallmeHome()
End Sub
Function getTeamViewerID() Function getTeamViewerID()
Dim Reg As String = Nothing Dim Reg As String = Nothing
@@ -375,4 +427,36 @@ Public Class Main
End Function End Function
Private Sub btnShowAnydesk_Click(sender As Object, e As EventArgs) Handles btnShowAnydesk.Click
Report()
End Sub
Public Function GetAnyDeskID() As String
Try
' Erstelle den Prozessstart-Info
Dim startInfo As New ProcessStartInfo()
startInfo.FileName = "cmd.exe"
startInfo.Arguments = "/C ""C:\Verag\AnyDeskClient-Portable.exe"" --get-id"
startInfo.RedirectStandardOutput = True
startInfo.UseShellExecute = False
startInfo.CreateNoWindow = True
' Starte den Prozess
Dim process As Process = Process.Start(startInfo)
' Lese die Ausgabe des Befehls
Dim output As String = process.StandardOutput.ReadToEnd()
process.WaitForExit()
' Bereinige und gebe die ID zurück
output = output.Trim()
Return output
Catch ex As Exception
' Fehlerbehandlung
Return "Fehler beim Abrufen der AnyDesk-ID: " & ex.Message
End Try
End Function
End Class End Class

View File

@@ -81,7 +81,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die 1.1.0.0 ähnelt. ''' Sucht eine lokalisierte Zeichenfolge, die 1.2.2.1 ähnelt.
'''</summary> '''</summary>
Public ReadOnly Property ProgVersion() As String Public ReadOnly Property ProgVersion() As String
Get Get

View File

@@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="ProgVersion" xml:space="preserve"> <data name="ProgVersion" xml:space="preserve">
<value>1.1.0.0</value> <value>1.2.2.1</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Reload20" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Reload20" type="System.Resources.ResXFileRef, System.Windows.Forms">

View File

@@ -29,7 +29,8 @@ Public Class cBenutzer
Hostname = Environment.MachineName Hostname = Environment.MachineName
SystemUpTime = GetSystemUpTimeInfo() SystemUpTime = GetSystemUpTimeInfo()
' MsgBox(SystemUpTime) ' MsgBox(SystemUpTime)
Catch Catch ex As Exception
MsgBox("FillWithLoggedOnUser" & ex.Message)
End Try End Try
Domäne = System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain.ToString Domäne = System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain.ToString
BenutzeranmeldeName = Environment.UserDomainName & "\" & Environment.UserName BenutzeranmeldeName = Environment.UserDomainName & "\" & Environment.UserName

View File

@@ -6,7 +6,8 @@ Public Class cChilkat_Helper
Public Shared Sub UnlockCilkat() Public Shared Sub UnlockCilkat()
Dim glob As Chilkat.[Global] = New Chilkat.[Global]() Dim glob As Chilkat.[Global] = New Chilkat.[Global]()
Dim success As Boolean = glob.UnlockBundle("VERAGS.CB1122022_JJ6kgS2zoR0g") 'Dim success As Boolean = glob.UnlockBundle("VERAGS.CB1122022_JJ6kgS2zoR0g")
Dim success As Boolean = glob.UnlockBundle("LUXBAU.CB1112026_zH49BXhFm802")
If success <> True Then If success <> True Then
Debug.WriteLine(glob.LastErrorText) Debug.WriteLine(glob.LastErrorText)

View File

@@ -29,7 +29,8 @@ Public Class cPascom
'BASIC Auth String: bW9ieTpYZ0RzRm1NU3V0YU1MQTE = 'BASIC Auth String: bW9ieTpYZ0RzRm1NU3V0YU1MQTE =
cChilkat_Helper.UnlockCilkat() cChilkat_Helper.UnlockCilkat()
Dim API_STRING = "pbx3.flashnet.at" ' Dim API_STRING = "pbx3.flashnet.at"
Dim API_STRING = TelUrl
Dim rest As New Chilkat.Rest Dim rest As New Chilkat.Rest
Dim success As Boolean Dim success As Boolean
@@ -117,7 +118,7 @@ Public Class cPascom
Public Function GetTelArbeitsplatz4Host() As Boolean Public Function GetTelArbeitsplatz4Host() As Boolean
Try Try
Dim lines = IO.File.ReadAllLines("\\dc01.verag.ost.dmn\NETLOGON\Telefonarbeitsplaetze.ini") Dim lines = IO.File.ReadAllLines("\\verag.ost.dmn\NETLOGON\Telefonarbeitsplaetze.ini")
Dim colCount = lines.First.Split(";"c).Length Dim colCount = lines.First.Split(";"c).Length
For Each line In lines For Each line In lines

View File

@@ -1,6 +1,7 @@
Imports System.IO Imports System.IO
Imports System.Net.Sockets Imports System.Net.Sockets
Imports System.Diagnostics.Process Imports System.Diagnostics.Process
Imports System.Net.NetworkInformation
Public Class cRes Public Class cRes
@@ -61,21 +62,21 @@ Public Class cRes
'sOutput = Date.Now & " : " & sOutputLine(sOutputLine.Count - 1).ToString() 'sOutput = Date.Now & " : " & sOutputLine(sOutputLine.Count - 1).ToString()
End Using End Using
sw.WriteLine(sOutput) sw.WriteLine(sOutput)
sw.Close() sw.Close()
Catch meh As Exception Catch meh As Exception
sw.WriteLine(Date.Now & ": Fehler beim Ausfuehren des Prozesses: " & meh.Message) sw.WriteLine(Date.Now & ": Fehler beim Ausfuehren des Prozesses: " & meh.Message)
sw.Close() sw.Close()
End Try End Try
Dim lineCount = File.ReadAllLines(speicherort).Length Dim lineCount = File.ReadAllLines(speicherort).Length
If lineCount > 2048 Then If lineCount > 2048 Then
Dim lines As List(Of String) = File.ReadAllLines(speicherort).ToList Dim lines As List(Of String) = File.ReadAllLines(speicherort).ToList
lines.RemoveRange(0, 8) lines.RemoveRange(0, 8)
File.WriteAllLines(speicherort, lines) File.WriteAllLines(speicherort, lines)
End If End If
End Using End Using
' MsgBox("Hier") ' MsgBox("Hier")
Catch ex As Exception Catch ex As Exception
End Try End Try
@@ -152,5 +153,21 @@ Public Class cRes
End Function End Function
Public Shared Function getserialnumber() As String
Dim colItems As New Object
Dim sn As String = ""
colItems = (GetObject("winmgmts:\\.\root\cimv2")).ExecQuery("Select * from Win32_Bios")
For Each objItem In colItems
'MsgBox("Seriennummer: " & objItem.SerialNumber)
sn = objItem.SerialNumber
Next
Return sn
End Function
Public Shared Function getMacAddress() As String
Dim nics() As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces()
Return nics(1).GetPhysicalAddress.ToString
End Function
End Class End Class