Chat etc.

This commit is contained in:
ms
2020-05-12 14:55:03 +02:00
parent 46a9991b2a
commit be5014153d
54 changed files with 1993 additions and 263 deletions

View File

@@ -1,5 +1,6 @@
Imports System.Data.SqlClient
Imports System.Reflection
Imports System.IO
Public Class Class1
@@ -819,4 +820,25 @@ Public Class Class1
'returnTable = dv.Table
Return returnTable
End Function
Public Shared Sub CopyDirectory(ByVal sourcePath As String, ByVal destinationPath As String)
Dim sourceDir As DirectoryInfo = New DirectoryInfo(sourcePath)
Dim sourceFiles As FileInfo() = sourceDir.GetFiles(sourcePath, "*")
For source As Integer = 0 To sourceFiles.Length - 1
Dim destinationDir As DirectoryInfo = New DirectoryInfo(destinationPath)
Dim destFiles As FileInfo() = destinationDir.GetFiles()
For destination As Integer = 0 To destFiles.Length - 1
If File.Exists(Path.Combine(destinationPath, sourceFiles(source).Name)) Then
If sourceFiles(source).Name = destFiles(destination).Name Then
If sourceFiles(source).LastWriteTime > destFiles(destination).LastWriteTime Then
sourceFiles(source).CopyTo(Path.Combine(destinationDir.FullName, sourceFiles(source).Name), True)
End If
End If
Else
sourceFiles(source).CopyTo(Path.Combine(destinationDir.FullName, sourceFiles(source).Name), True)
End If
Next
Next
End Sub
End Class

View File

@@ -15,7 +15,7 @@ Public Class cBenutzer
Property msDSPrincipalName As String = ""
Property localdistinguishedName As String = ""
Property suchname As String = ""
Property Hostname As String = ""
@@ -24,6 +24,7 @@ Public Class cBenutzer
Try
userPrincipalName = System.DirectoryServices.AccountManagement.UserPrincipal.Current.UserPrincipalName
Name = System.DirectoryServices.AccountManagement.UserPrincipal.Current.Name
Hostname = Environment.MachineName
Catch
End Try
Domäne = System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain.ToString

View File

@@ -0,0 +1,82 @@
Public Class cExtProgramme
Public Shared Function startlink(URL As String)
Try
If URL.Contains("http") Or URL.Contains("https") Then
Process.Start(URL)
ElseIf URL = "" Then
Exit Function
Else
Dim mstsc As New Process
mstsc.StartInfo.FileName = "mstsc.exe"
mstsc.StartInfo.Arguments = " /v: " & URL
mstsc.Start()
End If
' Process.Start("mstsc.exe", "/v: dc01")
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End Function
Public Shared Function startputty(IP As String)
Dim Benutzer, Passwort As String
Class1.GetUserPasswort(IP, Benutzer, Passwort)
Try
Dim putty As New Process
putty.StartInfo.FileName = "putty.exe"
If Benutzer = "" And Passwort = "" Then
putty.StartInfo.Arguments = IP
Else
putty.StartInfo.Arguments = IP & " -l " & Benutzer & " -pw " & Passwort
End If
putty.Start()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
Public Shared Function pingip(ip As String, Optional ByVal Argument As String = "")
Dim ping As New Process
'ping.StartInfo.FileName = "cmd.exe"
'ping.StartInfo.Arguments = " /k ping " & ip & Argument
ping.StartInfo.FileName = "powershell.exe"
ping.StartInfo.Arguments = " /noexit /c ping " & ip & Argument
ping.Start()
End Function
Public Shared Function msgsend(argumente As String)
Try
Dim msg As New Process
System.IO.File.WriteAllBytes("msg.exe", My.Resources.msg)
msg.StartInfo.FileName = "msg.exe"
'msg.StartInfo.WorkingDirectory = "C:\Windows\System32\"
msg.StartInfo.Arguments = argumente
msg.Start()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
Public Shared Function StartTeamviewer(ID As String, Optional Passwort As String = "BmWr501956")
If Passwort.Length < 1 Then
Passwort = "BmWr501956"
End If
Dim teamviewer As New Process
With teamviewer.StartInfo
.FileName = "Teamviewer.exe"
.WorkingDirectory = "C:\Program Files (x86)\TeamViewer"
.Arguments = "-i " & ID & " -P " & Passwort
End With
teamviewer.Start()
End Function
End Class