Chilkat, Telefone, Zoll Notruf
This commit is contained in:
51
Dokumentation/SMB.vb
Normal file
51
Dokumentation/SMB.vb
Normal file
@@ -0,0 +1,51 @@
|
||||
Imports System.DirectoryServices.ActiveDirectory
|
||||
|
||||
Public Class SMB
|
||||
|
||||
Dim ds As New DataSet
|
||||
Private Sub SMB_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Class1.EnableDoubleBuffered(dgv)
|
||||
|
||||
LoadSitzungen()
|
||||
LoadDGV()
|
||||
|
||||
End Sub
|
||||
|
||||
Function LoadSitzungen()
|
||||
Dim ps = cExtProgramme.RunRemotePSScript("stor10", "veragost\administrator", "+d#XisdBbSt!", "C:\Tools\SMBOpenFiles.ps1", True)
|
||||
cSMB.obj2DS(ps, ds, "SMB")
|
||||
|
||||
End Function
|
||||
|
||||
Function LoadDGV()
|
||||
|
||||
With dgv
|
||||
.DataSource = ds.Tables(0)
|
||||
.DefaultCellStyle.BackColor = Color.White
|
||||
.AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue
|
||||
|
||||
.SelectionMode = DataGridViewSelectionMode.FullRowSelect
|
||||
|
||||
.AutoResizeColumn(1)
|
||||
.AutoResizeColumn(2)
|
||||
.AutoResizeColumn(3)
|
||||
End With
|
||||
counter.Text = dgv.Rows.Count
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub Refresh_Click(sender As Object, e As EventArgs) Handles Refresh.Click
|
||||
ds.Reset()
|
||||
LoadSitzungen()
|
||||
LoadDGV()
|
||||
End Sub
|
||||
|
||||
Private Sub SitzungBeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SitzungBeendenToolStripMenuItem.Click
|
||||
Dim datei As String = dgv.CurrentRow.Cells("Datei").Value
|
||||
|
||||
Dim ps = cExtProgramme.RunRemotePSScript("stor10", "veragost\administrator", "+d#XisdBbSt!", "Get-SmbOpenFile | Where-Object {$_.ShareRelativePath -like '*" & datei & "*'} | close-SmbOpenFile -Force", False)
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user