Kleinigkeiten... glaub ich ....
This commit is contained in:
@@ -845,4 +845,14 @@ Public Class Class1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Shared Function WriteToFile(filepath As String, texttowrite As String)
|
||||
Try
|
||||
Dim objWriter As New System.IO.StreamWriter(filepath)
|
||||
objWriter.Write(texttowrite)
|
||||
objWriter.Close()
|
||||
Catch ex As Exception
|
||||
MsgBox(filepath & vbCrLf & " konnte nicht geschrieben werden." & vbCrLf & ex.Message)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -52,13 +52,14 @@
|
||||
ping.Start()
|
||||
End Function
|
||||
|
||||
Public Shared Function msgsend(argumente As String)
|
||||
Public Shared Function msgsend(argumente As String, Optional ByVal ReturnOrder As Boolean = False)
|
||||
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
|
||||
If ReturnOrder = True Then Return "msg.exe " & argumente : Exit Function
|
||||
msg.Start()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
@@ -79,4 +80,39 @@
|
||||
teamviewer.Start()
|
||||
End Function
|
||||
|
||||
Public Shared Function RDPConnect(host As String, Optional ByVal Username As String = "", Optional ByVal Password As String = "")
|
||||
Dim mstsc As New Process
|
||||
Dim AnmeldeDatenVorhanden As Boolean = False
|
||||
|
||||
If Username.Length > 0 And Password.Length > 0 Then
|
||||
Dim Anmeldung As New Process : AnmeldeDatenVorhanden = True
|
||||
With Anmeldung
|
||||
.StartInfo.FileName = Environment.ExpandEnvironmentVariables("%SystemRoot%\system32\cmdkey.exe")
|
||||
.StartInfo.Arguments = "/add:TERMSRV/" & host & " /user:" & Username & " /pass:" & Password
|
||||
.Start()
|
||||
End With
|
||||
End If
|
||||
|
||||
mstsc.StartInfo.FileName = "mstsc.exe"
|
||||
mstsc.StartInfo.UseShellExecute = False
|
||||
mstsc.StartInfo.Arguments = " /v: " & host
|
||||
|
||||
mstsc.Start()
|
||||
|
||||
If AnmeldeDatenVorhanden = True Then
|
||||
Threading.Thread.Sleep(3000)
|
||||
|
||||
Dim Abmeldung As New Process
|
||||
With Abmeldung
|
||||
.StartInfo.FileName = Environment.ExpandEnvironmentVariables("%SystemRoot%\system32\cmdkey.exe")
|
||||
.StartInfo.Arguments = "/delete:TERMSRV/" & host
|
||||
End With
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
@@ -14,4 +14,10 @@
|
||||
Me.NameKurz = Me.BenutzerAnmeldeName.Substring(i + 1, Me.BenutzerAnmeldeName.Length - (i + 1))
|
||||
End Function
|
||||
|
||||
Public Shared Function genNameKurz(langername As String)
|
||||
Dim i As Integer = langername.IndexOf("\")
|
||||
Dim kn As String = langername.Substring(i + 1, langername.Length - (i + 1))
|
||||
Return kn
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user