Diverse Bug-Fixes; Umstellung auf FQDN statt IP Adressen;

This commit is contained in:
ms
2019-10-03 16:49:23 +02:00
parent c0d894546a
commit ce28d0bcce
7 changed files with 78 additions and 37 deletions

View File

@@ -51,8 +51,10 @@ Public Class Class1
Class1.DBConString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.FilePath = "\\192.168.0.253\backup\temp_Sebastian\DokuTest"
Else
Class1.DBConString = "Server=192.168.0.94\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.FilePath = "\\192.168.0.90\f\EDV-Wartung\Dokumentation"
'Class1.DBConString = "Server=192.168.0.94\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
Class1.DBConString = "Server=buchhaltung.verag.ost.dmn\SQLEXPRESS;Initial Catalog=Doku;User ID=sa;Password=BmWr501956;Connection Timeout=5;"
'Class1.FilePath = "\\192.168.0.90\f\EDV-Wartung\Dokumentation"
Class1.FilePath = "\\DEVELOPER.verag.ost.dmn\f\EDV-Wartung\Dokumentation"
End If
End Function

View File

@@ -22,7 +22,7 @@
End Function
Public Shared Function explorerstarten(ip As String, Optional ByVal smb As Boolean = False)
Public Shared Function explorerstarten(ip As String, Optional ByVal smb As Boolean = False, Optional ByVal username As String = "", Optional ByVal password As String = "")
Dim Path, nwstandort, netname As String
Dim host As New cHost
If smb = False Then
@@ -42,8 +42,36 @@
End If
Else
Path = "\\" & ip
If Not username = "" Then
netuse(username, password, Path)
End If
Process.Start(Path)
End If
'MsgBox(path)
End Function
Public Shared Function netuse(ByVal user As String, ByVal password As String, ByVal path As String)
Dim _netuse As New System.Diagnostics.ProcessStartInfo()
_netuse.CreateNoWindow = True
_netuse.WindowStyle = ProcessWindowStyle.Hidden
_netuse.FileName = "C:\Windows\system32\net"
_netuse.Arguments = " use " & path & " /User:" & user & " " & password
System.Diagnostics.Process.Start(_netuse)
End Function
Public Shared Function netdelete(ByVal path As String)
Dim _netuse As New System.Diagnostics.ProcessStartInfo()
_netuse.CreateNoWindow = True
_netuse.WindowStyle = ProcessWindowStyle.Hidden
_netuse.FileName = "C:\Windows\system32\net"
_netuse.Arguments = " use " & path & " /delete"
System.Diagnostics.Process.Start(_netuse)
End Function
End Class

View File

@@ -616,30 +616,7 @@ Public Class Main
End Function
Private Sub CmdTest_Click(sender As Object, e As EventArgs) Handles CmdTest.Click
Dim i As Integer = 0
Dim Width As Integer = 0
Dim frm As New frmLeer
frm.Text = "Berechtigungen"
Dim tempUser As New cBenutzer
tempUser.FillWithLoggedOnUser()
For Each Standort As String In LstStandort.Items
Dim usrcntrl As New uscntr_Berechtigungen
usrcntrl.User = tempUser
usrcntrl.lblName.Text = Standort
usrcntrl.Name = Standort
usrcntrl.Standort = Standort
usrcntrl.Location = New Point(0, i * usrcntrl.Height)
i = i + 1
frm.PanMain.Controls.Add(usrcntrl)
Width = usrcntrl.Width
Next
frm.Width = Width
frm.Show()
cFolder.netdelete("10.4.3.17")
End Sub
@@ -1235,10 +1212,7 @@ Public Class Main
End Sub
Private Sub btnTest3_Click(sender As Object, e As EventArgs) Handles btnTest3.Click
Dim test As New cNetzwerk
test.getNetzwerk(LstStandort.SelectedItem, LstNetzwerk.SelectedItem)
test.getFirstHost()
MsgBox("STOP HIER")
cFolder.netuse("Verag", "1VerSub9#", "\\10.4.3.17")
End Sub
Private Sub ToolStripMenuItemINFO_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItemINFO.Click

View File

@@ -169,7 +169,7 @@ Namespace My.Resources
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die 0.0.1.34 ähnelt.
''' Sucht eine lokalisierte Zeichenfolge, die 0.0.1.35 ähnelt.
'''</summary>
Friend ReadOnly Property Version() As String
Get

View File

@@ -131,7 +131,7 @@
<value>..\Resources\Link.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Version" xml:space="preserve">
<value>0.0.1.34</value>
<value>0.0.1.35</value>
</data>
<data name="Link" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Link.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

View File

@@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmHostBearbeiten
Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
@@ -20,7 +20,7 @@ Partial Class frmHostBearbeiten
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmHostBearbeiten))
@@ -70,6 +70,7 @@ Partial Class frmHostBearbeiten
Me.CmdDelete = New System.Windows.Forms.Button()
Me.TxtBenutzername = New System.Windows.Forms.TextBox()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.cmdAuthSMB = New System.Windows.Forms.Button()
Me.cmdSMB = New System.Windows.Forms.Button()
Me.ChkShowSlaves = New System.Windows.Forms.CheckBox()
Me.lblSuchfilter = New System.Windows.Forms.Label()
@@ -297,6 +298,7 @@ Partial Class frmHostBearbeiten
Me.TxtInfo.Location = New System.Drawing.Point(332, 129)
Me.TxtInfo.Multiline = True
Me.TxtInfo.Name = "TxtInfo"
Me.TxtInfo.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.TxtInfo.Size = New System.Drawing.Size(300, 87)
Me.TxtInfo.TabIndex = 103
'
@@ -503,6 +505,7 @@ Partial Class frmHostBearbeiten
'
'Panel1
'
Me.Panel1.Controls.Add(Me.cmdAuthSMB)
Me.Panel1.Controls.Add(Me.cmdSMB)
Me.Panel1.Controls.Add(Me.ChkShowSlaves)
Me.Panel1.Controls.Add(Me.TxtBenutzername)
@@ -548,6 +551,18 @@ Partial Class frmHostBearbeiten
Me.Panel1.Size = New System.Drawing.Size(643, 415)
Me.Panel1.TabIndex = 137
'
'cmdAuthSMB
'
Me.cmdAuthSMB.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.cmdAuthSMB.FlatAppearance.BorderColor = System.Drawing.Color.DimGray
Me.cmdAuthSMB.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cmdAuthSMB.Location = New System.Drawing.Point(434, 378)
Me.cmdAuthSMB.Name = "cmdAuthSMB"
Me.cmdAuthSMB.Size = New System.Drawing.Size(96, 23)
Me.cmdAuthSMB.TabIndex = 139
Me.cmdAuthSMB.Text = "Auth. SMB"
Me.cmdAuthSMB.UseVisualStyleBackColor = False
'
'cmdSMB
'
Me.cmdSMB.BackColor = System.Drawing.SystemColors.ControlLightLight
@@ -692,4 +707,5 @@ Partial Class frmHostBearbeiten
Friend WithEvents lblSuchfilter As Label
Friend WithEvents PanNavTop As Panel
Friend WithEvents cmdSMB As Button
Friend WithEvents cmdAuthSMB As Button
End Class

View File

@@ -306,11 +306,17 @@
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.ControlKey Then cmdAuthSMB.Text = "NetDelete"
If e.KeyCode = Keys.Escape Then
Me.Close()
End If
End Sub
Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) Handles Me.KeyUp
cmdAuthSMB.Text = "Auth. SMB"
End Sub
Private Sub MitHTTPFüllenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MitHTTPFüllenToolStripMenuItem.Click
TxtLink.Text = "http://" & TxtIP.Text & "/"
End Sub
@@ -329,5 +335,20 @@
Clipboard.SetText(host.IPAdresse)
End Sub
Private Sub CmdAuthSMB_Click(sender As Object, e As EventArgs) Handles cmdAuthSMB.Click
If cmdAuthSMB.Text = "Auth. SMB" Then
' cFolder.netdelete("\\" & host.IPAdresse)
cFolder.netuse(host.Benutzer, host.Passwort, "\\" & host.IPAdresse)
cFolder.explorerstarten(host.IPAdresse, True)
Else
cFolder.netdelete("\\" & host.IPAdresse)
End If
End Sub
Private Sub CmdSMBReset_Click(sender As Object, e As EventArgs)
cFolder.netdelete("\\" & host.IPAdresse)
End Sub
End Class