Initial commit
This commit is contained in:
42
Archiv/20140831_EDKB08/EDKB08_GSF/DivFnk.vb
Normal file
42
Archiv/20140831_EDKB08/EDKB08_GSF/DivFnk.vb
Normal file
@@ -0,0 +1,42 @@
|
||||
Module DivFnk
|
||||
|
||||
Public Function FolderExist(ByVal dn As String) As Boolean
|
||||
Try
|
||||
If System.IO.Directory.Exists(dn) Then FolderExist = True Else FolderExist = False
|
||||
Catch
|
||||
FolderExist = False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Create_Folders(ByVal s As String) As Boolean
|
||||
Dim xt(10) As String
|
||||
Dim xti As Integer
|
||||
Dim po As Integer
|
||||
Dim x As String = ""
|
||||
Dim xti1 As Integer
|
||||
po = InStr(s, "\")
|
||||
xti = 0
|
||||
While po <> 0
|
||||
xt(xti) = Left(s, po - 1)
|
||||
xti = xti + 1
|
||||
s = Right(s, Len(s) - (po))
|
||||
po = InStr(s, "\")
|
||||
End While
|
||||
xt(xti) = s
|
||||
For xti1 = 0 To xti
|
||||
If x <> "" Then x = x & "\"
|
||||
x = x & xt(xti1)
|
||||
If Not FolderExist(x) Then Create_Folder(x)
|
||||
Next
|
||||
Create_Folders = True
|
||||
End Function
|
||||
|
||||
Public Function Create_Folder(ByVal dn As String) As Boolean
|
||||
Try
|
||||
System.IO.Directory.CreateDirectory(dn)
|
||||
Catch
|
||||
Create_Folder = False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user