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
|
||||
@@ -104,6 +104,11 @@
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="VERAGMonitoringUPDATER_Settings.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
F:\Programme\VERAGMonitoring\
|
||||
192.168.0.**|\\share01.verag.ost.dmn\Programme\VERAGMonitoring\
|
||||
172.16.0.**|\\172.16.0.99\Daten\PROGRAMME\VERAGMonitoring\
|
||||
192.168.1.**|\\192.168.1.20\daten\VERAG Programme\VERAGMonitoring\
|
||||
192.168.133.**|\\192.168.133.98\f\Programme\VERAGMonitoring\
|
||||
172.16.1.**|\\172.16.1.100\f\PROGRAMME\VERAGMonitoring\
|
||||
192.168.32.**|\\192.168.32.253\Files\Programme\VERAGMonitoring\
|
||||
192.168.100.**|\\192.168.100.11\Daten\Programme\VERAGMonitoring\
|
||||
10.4.**|\\10.4.3.17\VERAG gemeinsam\VERAGMonitoring\
|
||||
Reference in New Issue
Block a user