45 lines
1.4 KiB
VB.net
45 lines
1.4 KiB
VB.net
Public Class cFolder
|
|
|
|
Public Shared Function FolderMove(oldID As String, oldHost As String, newID As String, NewHost As String)
|
|
Dim PathOld As String
|
|
Dim PathNew As String
|
|
|
|
PathOld = Class1.FilePath & "\" & oldID & "\" & oldHost
|
|
PathNew = Class1.FilePath & "\" & newID & "\" & NewHost
|
|
|
|
If IO.Directory.Exists(PathNew) Then
|
|
MsgBox("Zielordner existiert bereits! Abbruch.")
|
|
Return "Fehler"
|
|
End If
|
|
If IO.Directory.Exists(Class1.FilePath & "\" & newID) Then
|
|
Else
|
|
IO.Directory.CreateDirectory(Class1.FilePath & "\" & newID)
|
|
End If
|
|
|
|
If IO.Directory.Exists(PathOld) Then
|
|
IO.Directory.Move(PathOld, PathNew)
|
|
End If
|
|
|
|
End Function
|
|
|
|
Public Shared Function explorerstarten(ip As String)
|
|
Dim Path, nwstandort, netname As String
|
|
Dim host As New Host
|
|
host.gethost(ip)
|
|
If host.Linked = True Then
|
|
host.gethost(host.LinkedWith)
|
|
End If
|
|
Class1.ip2netname(host.IPAdresse, nwstandort, netname)
|
|
|
|
Path = Class1.FilePath & "\" & nwstandort & "_" & netname & "\" & host.HOST
|
|
|
|
If IO.Directory.Exists(Path) Then
|
|
Process.Start(Path)
|
|
Else
|
|
IO.Directory.CreateDirectory(Path)
|
|
Process.Start(Path)
|
|
End If
|
|
'MsgBox(path)
|
|
End Function
|
|
End Class
|