neu
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
Module Update
|
||||
|
||||
Dim F_PFAD = "F:\Programme\VERAGMonitoring\"
|
||||
Sub Main()
|
||||
If Not My.Computer.FileSystem.DirectoryExists("F:\Programme\VERAGMonitoring\") Then
|
||||
|
||||
If Not System.IO.Directory.Exists(F_PFAD) Then
|
||||
F_PFAD = getFByIP()
|
||||
End If
|
||||
|
||||
|
||||
If Not My.Computer.FileSystem.DirectoryExists(F_PFAD) Then
|
||||
MsgBox("ERROR_UPDATE_02: Update-Daten existieren nicht.", MsgBoxStyle.Critical, "ERROR")
|
||||
Else
|
||||
For i As Integer = 1 To 3 Step 1
|
||||
@@ -21,11 +29,11 @@
|
||||
Environment.Exit(0)
|
||||
End Sub
|
||||
Private Sub FileCopier()
|
||||
For Each file As String In IO.Directory.GetFiles("F:\Programme\VERAGMonitoring\") ' Ermittelt alle Dateien des Ordners
|
||||
For Each file As String In IO.Directory.GetFiles(F_PFAD) ' Ermittelt alle Dateien des Ordners
|
||||
If cut_file(file).Contains("settings.txt") = False Then
|
||||
IO.File.Copy(file, AppDomain.CurrentDomain.BaseDirectory & cut_file(file), True) ' Kopiert die Dateien Next
|
||||
End If
|
||||
For Each filed As String In IO.Directory.GetDirectories("F:\Programme\VERAGMonitoring\") ' Ermittelt alle Unterordner des Ordners
|
||||
For Each filed As String In IO.Directory.GetDirectories(F_PFAD) ' Ermittelt alle Unterordner des Ordners
|
||||
My.Computer.FileSystem.CopyDirectory(filed, AppDomain.CurrentDomain.BaseDirectory & cut_file(filed), True)
|
||||
Next
|
||||
Next
|
||||
@@ -60,4 +68,35 @@
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
Function getFByIP() As String
|
||||
Dim default_F = ""
|
||||
getFByIP = ""
|
||||
Try
|
||||
Dim IPADDR As System.Net.IPAddress
|
||||
IPADDR = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList(0)
|
||||
'MsgBox(IPADDR.ToString())
|
||||
|
||||
For Each l In System.IO.File.ReadAllLines(AppDomain.CurrentDomain.BaseDirectory & "VERAGMonitoringUPDATER_Settings.txt")
|
||||
If l.Contains("|") Then
|
||||
Dim sp = l.Split("|")
|
||||
If IPADDR.ToString.Contains(sp(0).Replace("**", "")) Then
|
||||
getFByIP = sp(1)
|
||||
End If
|
||||
Else
|
||||
default_F = l
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
If getFByIP = "" Then
|
||||
If default_F <> "" Then
|
||||
getFByIP = default_F
|
||||
Else
|
||||
getFByIP = F_PFAD
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user