Chilkat, Telefone, Zoll Notruf

This commit is contained in:
ms
2024-09-02 13:40:30 +02:00
parent e4f7efacc0
commit 5b4354daa1
38 changed files with 1351 additions and 315 deletions

View File

@@ -897,4 +897,12 @@ Public Class Class1
End Try
End Function
Public Shared Function txt2DS(txt As String, ByVal ds As DataSet)
Dim rowData As String() = txt.Split(New Char() {";"c}, StringSplitOptions.RemoveEmptyEntries)
End Function
End Class

View File

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

View File

@@ -1,4 +1,7 @@
Imports System.IO
Imports System.Management.Automation
Imports System.Management.Automation.Runspaces
Imports System.Security
Public Class cExtProgramme
@@ -14,10 +17,9 @@ Public Class cExtProgramme
edge.StartInfo.Arguments = " " & URL
edge.Start()
End If
ElseIf URL = "" Then
Exit Function
Else
Exit Function
Else
Dim mstsc As New Process
mstsc.StartInfo.FileName = "mstsc.exe"
mstsc.StartInfo.Arguments = " /v: " & URL
@@ -72,6 +74,38 @@ Public Class cExtProgramme
ping.Start()
End Function
Public Shared Function RunRemotePSScript(ByVal connectTo As String, ByVal user As String, ByVal password As String, ByVal script As String, Optional ByVal ps1 As Boolean = False) As System.Collections.ObjectModel.Collection(Of PSObject)
Const SHELL_URI As String = "http://schemas.microsoft.com/powershell/Microsoft.PowerShell"
Dim serverUri As New Uri("http://" & connectTo & ":5985/wsman")
Dim securepass As New SecureString
Dim c As Char
For Each c In password
securepass.AppendChar(c)
Next
Dim remotecred As New PSCredential(user, securepass)
Dim connectionInfo As New WSManConnectionInfo(serverUri, SHELL_URI, remotecred)
Dim myRunSpace As Runspace = RunspaceFactory.CreateRunspace(connectionInfo)
Dim psresult As New System.Collections.ObjectModel.Collection(Of PSObject)
myRunSpace.Open()
Dim psh As PowerShell = PowerShell.Create()
psh.Runspace = myRunSpace
If ps1 = False Then
psh.AddScript(script)
Else
psh.AddCommand(script)
End If
psh.Invoke(Nothing, psresult)
Return psresult
psh.Dispose()
myRunSpace.Close()
End Function
Public Shared Function msgsend(argumente As String, Optional ByVal ReturnOrder As Boolean = False)
Try
Dim msg As New Process
@@ -109,14 +143,15 @@ Public Class cExtProgramme
End Try
End Function
Public Shared Function RDPConnect(host As String, Optional ByVal Username As String = "", Optional ByVal Password As String = "", Optional ByVal Fenster As Boolean = False)
Public Shared Function RDPConnect(host As String, Optional ByVal Username As String = "", Optional ByVal Password As String = "", Optional ByVal Fenster As Boolean = False, Optional ByVal admin As Boolean = False)
Dim mstsc As New Process
Dim AnmeldeDatenVorhanden As Boolean = False
Dim rdpASadmin As String = ""
If admin Then rdpASadmin = " /admin"
Dim FensterString As String = ""
If Fenster = True Then
FensterString = " /w:1280 /h:1024"
FensterString = " /w:1920 /h:1080"
Else
FensterString = " /f"
End If

View File

@@ -3,7 +3,7 @@ Imports System.IO
Public Class cINI
Public sAppPath As String = Application.StartupPath
Public Shared sAppPath As String = Application.StartupPath
Dim cINIPropertys = New List(Of MemberInfo)
Dim INIfile As String = sAppPath & "\config.ini"

View File

@@ -1,12 +1,21 @@
Imports System.Reflection
Imports Chilkat
Imports VERAG_PROG_ALLGEMEIN.cCreditSafeAPI
Public Class cPascom
Dim API_USER_AUTHORIZATION = "bW9ieTpnWlhTSVprTnhmaUQxOEU="
Property Arbeitsplatz As String = ""
Property Username As String = ""
Dim TelUrl As String = ""
Sub New()
Dim ds As New DataSet
cSQL.SQL2DS("SELECT Parameter FROM [Doku].[dbo].[TbL_Dienste] where name = 'TelefonanlageURL'", ds)
If ds.Tables(0).Rows.Count > 0 Then
TelUrl = ds.Tables(0).Rows(0).Item(0).ToString
End If
End Sub
Public Function Anmelden() As Boolean
If Arbeitsplatz.Length > 0 And Username.Length > 0 Then
@@ -19,7 +28,7 @@ Public Class cPascom
'BASIC Auth String: bW9ieTpYZ0RzRm1NU3V0YU1MQTE =
cChilkat_Helper.UnlockCilkat()
Dim API_STRING = "pbx3.flashnet.at"
Dim API_STRING = TelUrl
Dim rest As New Chilkat.Rest
Dim success As Boolean
@@ -101,7 +110,7 @@ Public Class cPascom
Try
cChilkat_Helper.UnlockCilkat()
Dim API_STRING = "pbx3.flashnet.at"
Dim API_STRING = TelUrl
Dim rest As New Chilkat.Rest
Dim success As Boolean
@@ -182,7 +191,7 @@ Public Class cPascom
Try
cChilkat_Helper.UnlockCilkat()
Dim API_STRING = "pbx3.flashnet.at"
Dim API_STRING = TelUrl
Dim rest As New Chilkat.Rest
Dim success As Boolean

View File

@@ -0,0 +1,6 @@
Public Class cPowershellScripts
Public Shared userprofile As String = "$openfiles = Get-SmbOpenFile | select-object ShareRelativePath | out-string -stream ; foreach ($file in $openfiles) { try{ if ($file.length -gt 40) { $i = $file.substring(5,43); $SID = New-Object System.Security.Principal.SecurityIdentifier($i); $User = $SID.Translate([System.Security.Principal.NTAccount]); $U = $User.Value; write-host $i $U; $R.add($file + $i)}} catch {} }"
End Class

View File

@@ -0,0 +1,26 @@
Public Class cSMB
Public Shared Function obj2DS(obj As Object, ByVal ds As DataSet, tablename As String)
ds.Tables.Add(New DataTable(tablename))
With ds.Tables(0)
.Columns.Add("S_ID", Type.GetType("System.String"))
.Columns.Add("Computer", Type.GetType("System.String"))
.Columns.Add("Datei", Type.GetType("System.String"))
.Columns.Add("User", Type.GetType("System.String"))
End With
For Each line In obj
Dim rowData As String() = line.Split(New Char() {";"c})
ds.Tables(0).Rows.Add(rowData(0), rowData(1), rowData(2), rowData(3))
Next
' MsgBox("")
End Function
End Class