MS24112015
This commit is contained in:
@@ -3,35 +3,165 @@ Imports Microsoft.Office.Interop
|
||||
Imports Independentsoft
|
||||
Imports DLLLicenseManager
|
||||
Imports System.Text
|
||||
Imports System.Globalization
|
||||
Imports System.Threading
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
Public Class frmStart
|
||||
Dim sql_User_Login As String = "UPDATE TBDD_USER SET LOGGED_IN = @LogInOut, LOGGED_WHERE = '@ANGEMELDETWO' WHERE (LOWER(USERNAME) = LOWER('@user'))"
|
||||
Dim sql_UserID As String = "SELECT GUID FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('@user'))"
|
||||
Private USER_GUID
|
||||
Private ISUserAdmin As Boolean = False
|
||||
Public _lizenzManager As ClassLicenseManager
|
||||
Dim loaded As Boolean = False
|
||||
Dim WithEvents HotKey As New clsHotkey(Me)
|
||||
Public Sub SetLanguage()
|
||||
Dim de = System.Globalization.CultureInfo.CurrentUICulture
|
||||
'Neue Sprache festlegen und entfernen aller Controls
|
||||
|
||||
Private Sub frmMain_DragDrop(sender As Object, e As DragEventArgs) Handles MyBase.DragDrop
|
||||
ClassDragDrop.Drop_File(e)
|
||||
Check_Dropped_Files()
|
||||
End Sub
|
||||
Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles HotKey.HotKeyPressed
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Me.NotifyIcon1.Visible = True
|
||||
NotifyIcon1.ShowBalloonTip(2000, "Hotkey", "Hotkey wird ausgeführt!", ToolTipIcon.Info)
|
||||
|
||||
Thread.CurrentThread.CurrentUICulture = New CultureInfo(USER_LANGUAGE)
|
||||
Me.Controls.Clear()
|
||||
|
||||
'Me.Events.Dispose()
|
||||
|
||||
InitializeComponent()
|
||||
tslblCultureInfo.Text = "Culture/Language: " & USER_LANGUAGE
|
||||
Try
|
||||
'Die vorherige Tempfile löschen
|
||||
If CURRENT_WD_TEMPSEARCH <> "" Then
|
||||
If My.Computer.FileSystem.FileExists(CURRENT_WD_TEMPSEARCH) Then
|
||||
Try
|
||||
My.Computer.FileSystem.DeleteFile(CURRENT_WD_TEMPSEARCH)
|
||||
Catch ex As Exception
|
||||
Dim Ic As Icon = New Icon(Application.StartupPath & "\DD_Icons_ICO_GLOBIX_128.ico")
|
||||
If Not IsNothing(Ic) Then
|
||||
Me.Icon = Ic
|
||||
End If
|
||||
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Icon file could not be read: " & ex.Message, False)
|
||||
End Try
|
||||
|
||||
'Me.i()
|
||||
'Wiederherstellen der Fensterposition
|
||||
'Me.Size = sz
|
||||
'Me.Location = pt
|
||||
End Sub
|
||||
|
||||
Private Const mSnapOffset As Integer = 35
|
||||
Private Const WM_WINDOWPOSCHANGING As Integer = &H46
|
||||
|
||||
<StructLayout(LayoutKind.Sequential)> _
|
||||
Public Structure WINDOWPOS
|
||||
Public hwnd As IntPtr
|
||||
Public hwndInsertAfter As IntPtr
|
||||
Public x As Integer
|
||||
Public y As Integer
|
||||
Public cx As Integer
|
||||
Public cy As Integer
|
||||
Public flags As Integer
|
||||
End Structure
|
||||
|
||||
Protected Overrides Sub WndProc(ByRef m As Message)
|
||||
' Listen for operating system messages
|
||||
Select Case m.Msg
|
||||
Case WM_WINDOWPOSCHANGING
|
||||
SnapToDesktopBorder(Me, m.LParam, 0)
|
||||
End Select
|
||||
|
||||
MyBase.WndProc(m)
|
||||
End Sub
|
||||
Public Shared Sub SnapToDesktopBorder(ByVal clientForm _
|
||||
As Form, ByVal LParam As IntPtr, ByVal widthAdjustment As Integer)
|
||||
If clientForm Is Nothing Then
|
||||
' Satisfies rule: Validate parameters
|
||||
Throw New ArgumentNullException("clientForm")
|
||||
End If
|
||||
|
||||
' Snap client to the top, left, bottom or right desktop border
|
||||
' as the form is moved near that border.
|
||||
|
||||
Try
|
||||
' Marshal the LPARAM value which is a WINDOWPOS struct
|
||||
Dim NewPosition As New WINDOWPOS
|
||||
NewPosition = CType(Runtime.InteropServices.Marshal.PtrToStructure( _
|
||||
LParam, GetType(WINDOWPOS)), WINDOWPOS)
|
||||
|
||||
If NewPosition.y = 0 OrElse NewPosition.x = 0 Then
|
||||
Return ' Nothing to do!
|
||||
End If
|
||||
|
||||
' Adjust the client size for borders and caption bar
|
||||
Dim ClientRect As Rectangle = _
|
||||
clientForm.RectangleToScreen(clientForm.ClientRectangle)
|
||||
ClientRect.Width += _
|
||||
SystemInformation.FrameBorderSize.Width - widthAdjustment
|
||||
ClientRect.Height += (SystemInformation.FrameBorderSize.Height + _
|
||||
SystemInformation.CaptionHeight)
|
||||
|
||||
' Now get the screen working area (without taskbar)
|
||||
Dim WorkingRect As Rectangle = _
|
||||
Screen.GetWorkingArea(clientForm.ClientRectangle)
|
||||
|
||||
' Left border
|
||||
If NewPosition.x >= WorkingRect.X - mSnapOffset AndAlso _
|
||||
NewPosition.x <= WorkingRect.X + mSnapOffset Then
|
||||
NewPosition.x = WorkingRect.X
|
||||
End If
|
||||
|
||||
' Get screen bounds and taskbar height
|
||||
' (when taskbar is horizontal)
|
||||
Dim ScreenRect As Rectangle = _
|
||||
Screen.GetBounds(Screen.PrimaryScreen.Bounds)
|
||||
Dim TaskbarHeight As Integer = _
|
||||
ScreenRect.Height - WorkingRect.Height
|
||||
|
||||
' Top border (check if taskbar is on top
|
||||
' or bottom via WorkingRect.Y)
|
||||
If NewPosition.y >= -mSnapOffset AndAlso _
|
||||
(WorkingRect.Y > 0 AndAlso NewPosition.y <= _
|
||||
(TaskbarHeight + mSnapOffset)) OrElse _
|
||||
(WorkingRect.Y <= 0 AndAlso NewPosition.y <= _
|
||||
(mSnapOffset)) Then
|
||||
If TaskbarHeight > 0 Then
|
||||
NewPosition.y = WorkingRect.Y ' Horizontal Taskbar
|
||||
Else
|
||||
NewPosition.y = 0 ' Vertical Taskbar
|
||||
End If
|
||||
End If
|
||||
|
||||
' Right border
|
||||
If NewPosition.x + ClientRect.Width <= _
|
||||
WorkingRect.Right + mSnapOffset AndAlso _
|
||||
NewPosition.x + ClientRect.Width >= _
|
||||
WorkingRect.Right - mSnapOffset Then
|
||||
NewPosition.x = WorkingRect.Right - (ClientRect.Width + _
|
||||
SystemInformation.FrameBorderSize.Width)
|
||||
End If
|
||||
|
||||
' Bottom border
|
||||
If NewPosition.y + ClientRect.Height <= _
|
||||
WorkingRect.Bottom + mSnapOffset AndAlso _
|
||||
NewPosition.y + ClientRect.Height >= _
|
||||
WorkingRect.Bottom - mSnapOffset Then
|
||||
NewPosition.y = WorkingRect.Bottom - (ClientRect.Height + _
|
||||
SystemInformation.FrameBorderSize.Height)
|
||||
End If
|
||||
|
||||
' Marshal it back
|
||||
Runtime.InteropServices.Marshal.StructureToPtr(NewPosition, _
|
||||
LParam, True)
|
||||
Catch ex As ArgumentException
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_DragDrop(sender As Object, e As DragEventArgs) Handles MyBase.DragDrop
|
||||
If ClassDragDrop.Drop_File(e) = True Then
|
||||
TimerCheckDroppedFiles.Start()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles HotKey.HotKeyPressed
|
||||
Dim CapTxt As String = ClassHotkey_Windream.GetCaption()
|
||||
CURRENT_FOCUSES_WINDOWNAME = CapTxt
|
||||
If CURRENT_FOCUSES_WINDOWNAME.ToUpper.StartsWith("GLOB") Then Exit Sub
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" ...Focused window result: '" & CURRENT_FOCUSES_WINDOWNAME & "'", False)
|
||||
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Me.NotifyIcon1.Visible = True
|
||||
NotifyIcon1.ShowBalloonTip(1000, "Hotkey", "Hotkey wird ausgeführt!", ToolTipIcon.Info)
|
||||
Try
|
||||
Dim _focusedWindowfound As Boolean = False
|
||||
Dim HK1 As String
|
||||
Dim HK2 As String
|
||||
'Die Hotkeys definieren
|
||||
@@ -45,11 +175,25 @@ Public Class frmStart
|
||||
Dim DTHOTKEY_PROFILES As DataTable = ClassDatabase.Return_Datatable(SQL, True)
|
||||
Dim Result As String = ""
|
||||
If Not IsNothing(DTHOTKEY_PROFILES) Then
|
||||
|
||||
'Jedes Hotkeyprofil des Users durchlaufen um zu überprüfen ob das CURRENT_FOCUSES_WINDOWNAME = dem konfiguriertem ist
|
||||
For Each row As DataRow In DTHOTKEY_PROFILES.Rows
|
||||
Result = ClassHotkey_Windream.RUN_WD_SEARCH(row.Item("GUID"))
|
||||
SQL = "select WINDOW_NAME from TBHOTKEY_PROFILE where GUID = " & row.Item("HKPROFILE_ID")
|
||||
'Konfigurierte windows-String speichern
|
||||
Dim windowconfigured = ClassDatabase.Execute_Scalar(SQL, MyConnectionString, True)
|
||||
'Focuses window enthalten??
|
||||
If CURRENT_FOCUSES_WINDOWNAME.ToUpper.Contains(windowconfigured.ToString.ToUpper) Or CURRENT_FOCUSES_WINDOWNAME.ToUpper = windowconfigured.ToString.ToUpper Then
|
||||
'Ja - also die windream-Suche ausführen
|
||||
_focusedWindowfound = True
|
||||
Result = ClassHotkey_Windream.RUN_WD_SEARCH(row.Item("GUID"))
|
||||
End If
|
||||
Next
|
||||
If _focusedWindowfound = False Then
|
||||
Result = "Focused Window not configured in hotkey"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Result = "" Then
|
||||
Me.NotifyIcon1.Visible = False
|
||||
Else
|
||||
@@ -80,50 +224,54 @@ Public Class frmStart
|
||||
e.Effect = DragDropEffects.None
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub Check_Dropped_Files()
|
||||
'Try
|
||||
Me.TopMost = False
|
||||
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
||||
CURRENT_ABBRUCH = 0
|
||||
Dim i As Integer
|
||||
For Each Str As Object In ClassDragDrop.files_dropped
|
||||
If Not Str Is Nothing Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> Check Drop-File: " & Str.ToString, False)
|
||||
Dim handleType As String = Str.Substring(0, Str.LastIndexOf("@") + 1)
|
||||
Dim filename As String = Str.Substring(Str.LastIndexOf("@") + 1)
|
||||
If ClassIndexFunctions.FileExistsinDropTable(filename) = False Then
|
||||
ClassFilehandle.Decide_FileHandle(filename, handleType)
|
||||
i += 1
|
||||
Else
|
||||
Console.WriteLine("File gibt es bereits")
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
Me.TopMost = True
|
||||
Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')"
|
||||
DTACTUAL_FILES = Nothing
|
||||
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
||||
ABORT_INDEXING = False
|
||||
If DTACTUAL_FILES.Rows.Count > 1 Then
|
||||
frmIndexFileList.ShowDialog()
|
||||
Sub Check_Dropped_Files()
|
||||
Try
|
||||
Me.TopMost = False
|
||||
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
||||
CURRENT_ABBRUCH = 0
|
||||
Dim i As Integer
|
||||
For Each Str As Object In ClassDragDrop.files_dropped
|
||||
If Not Str Is Nothing Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> Check Drop-File: " & Str.ToString, False)
|
||||
Dim handleType As String = Str.Substring(0, Str.LastIndexOf("@") + 1)
|
||||
Dim filename As String = Str.Substring(Str.LastIndexOf("@") + 1)
|
||||
If ClassIndexFunctions.FileExistsinDropTable(filename) = False Then
|
||||
ClassFilehandle.Decide_FileHandle(filename, handleType)
|
||||
i += 1
|
||||
Else
|
||||
Console.WriteLine("File gibt es bereits")
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')"
|
||||
DTACTUAL_FILES = Nothing
|
||||
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
||||
End If
|
||||
For Each Filerow As DataRow In DTACTUAL_FILES.Rows
|
||||
Dim filestring As String = Filerow.Item("FILENAME2WORK")
|
||||
CURRENT_FILENAME = Filerow.Item("FILENAME2WORK")
|
||||
CURRENT_WORKFILE_GUID = Filerow.Item(0)
|
||||
CURRENT_WORKFILE = Filerow.Item("FILENAME2WORK")
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> CURRENT_WORKFILE: " & CURRENT_WORKFILE, False)
|
||||
If File.Exists(CURRENT_WORKFILE) Then
|
||||
Open_IndexDialog()
|
||||
Else
|
||||
Console.WriteLine("File existiert nicht mehr!")
|
||||
ABORT_INDEXING = False
|
||||
If DTACTUAL_FILES.Rows.Count > 1 Then
|
||||
frmIndexFileList.ShowDialog()
|
||||
DTACTUAL_FILES = Nothing
|
||||
DTACTUAL_FILES = ClassDatabase.Return_Datatable(sql, True)
|
||||
End If
|
||||
For Each Filerow As DataRow In DTACTUAL_FILES.Rows
|
||||
Dim filestring As String = Filerow.Item("FILENAME2WORK")
|
||||
CURRENT_FILENAME = Filerow.Item("FILENAME2WORK")
|
||||
CURRENT_WORKFILE_GUID = Filerow.Item(0)
|
||||
CURRENT_WORKFILE = Filerow.Item("FILENAME2WORK")
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> CURRENT_WORKFILE: " & CURRENT_WORKFILE, False)
|
||||
If File.Exists(CURRENT_WORKFILE) = True Then
|
||||
Open_IndexDialog()
|
||||
End If
|
||||
|
||||
Next
|
||||
Next
|
||||
Catch ex As Exception
|
||||
If Not ex.Message.StartsWith("Die Auflistung wurde geändert") Then
|
||||
MsgBox("Unexpected Error in Check_Dropped_Files:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End If
|
||||
End Try
|
||||
Me.TopMost = True
|
||||
End Sub
|
||||
|
||||
Sub Open_IndexDialog()
|
||||
@@ -136,33 +284,61 @@ Public Class frmStart
|
||||
If File.Exists(CURRENT_FILENAME) Then
|
||||
Select Case CURRENT_ABBRUCH
|
||||
Case 1
|
||||
MsgBox("Bitte indexieren Sie die Datei vollständig!" & vbNewLine & "(Abbruch 1 des Indexierungsvorgangs)", MsgBoxStyle.Information)
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Bitte indexieren Sie die Datei vollständig!" & vbNewLine & "(Abbruch 1 des Indexierungsvorgangs)", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("Please Index file completely" & vbNewLine & "(Abort 1 of Indexdialog)", MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
Open_IndexDialog()
|
||||
Case 2
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Sie brechen nun zum zweiten Mal den Indexierungsvorgang ab!" & vbNewLine & "Wollen Sie die Indexierung aller Dateien abbrechen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
result = MessageBox.Show("Sie brechen nun zum zweiten Mal den Indexierungsvorgang ab!" & vbNewLine & "Wollen Sie die Indexierung aller Dateien abbrechen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
Else
|
||||
result = MessageBox.Show("You abort the indexdialog for the 2nd time!" & vbNewLine & "Do You want to abort all file-indexing?", "Confirmation needed:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
End If
|
||||
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Dim containsfw_file As Boolean = False
|
||||
Try
|
||||
ABORT_INDEXING = True
|
||||
For Each Filerow As DataRow In DTACTUAL_FILES.Rows
|
||||
Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')"
|
||||
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
|
||||
|
||||
Dim anz = DT.Rows.Count
|
||||
For Each Filerow As DataRow In DT.Rows
|
||||
Dim filestring As String = Filerow.Item("FILENAME2WORK")
|
||||
Dim handletype As String = Filerow.Item("HANDLE_TYPE")
|
||||
|
||||
If handletype = "@MSGONLY@" Or handletype = "@ATTMNTEXTRACTED@" Then
|
||||
System.IO.File.Delete(filestring)
|
||||
Try
|
||||
System.IO.File.Delete(filestring)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
ElseIf handletype.StartsWith("@FW") Then
|
||||
containsfw_file = True
|
||||
End If
|
||||
Next
|
||||
'Zuerst die Daten des Ablaufs löschen
|
||||
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True)
|
||||
If containsfw_file = True Then
|
||||
MsgBox("Der Indexierungsprozess beinhaltete (auch) Dateien per Folderwatch!" & vbNewLine & "Diese Dateien wurden nicht gelöscht und verbleiben im Folderwatch-Verzeichnis!" & vbNewLine & "Bitte verschieben Sie die Dateien ggfls.", MsgBoxStyle.Information, "Achtung - Hinweis:")
|
||||
If ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True) = True Then
|
||||
If containsfw_file = True Then
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Der Indexierungsprozess beinhaltete (auch) Dateien per Folderwatch!" & vbNewLine & "Diese Dateien wurden nicht gelöscht und verbleiben im Folderwatch-Verzeichnis!" & vbNewLine & "Bitte verschieben Sie die Dateien ggfls.", MsgBoxStyle.Information, "Achtung - Hinweis:")
|
||||
Else
|
||||
MsgBox("The Indexingprocess contained (also) files from folderwatch!" & vbNewLine & "These files weren't deleted and will stay in the folderwatch-folder!" & vbNewLine & "Please move these files manually.", MsgBoxStyle.Information, "Achtung - Hinweis:")
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler bei Abbruch der Indexierung: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
MsgBox("Unexpected Error in Abort Indexing: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
|
||||
@@ -174,215 +350,135 @@ Public Class frmStart
|
||||
End Select
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Fehler bei Aufruf Indexdialog: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
MsgBox("Unexpected Error in Call Indexdialog: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Me.Visible = True
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub frmStart_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
Try
|
||||
ClassLogger.Add("", False)
|
||||
If START_INCOMPLETE = False Then
|
||||
Dim sql = sql_User_Login
|
||||
sql = sql.Replace("@LogInOut", 0)
|
||||
sql = sql.Replace("@ANGEMELDETWO", "''")
|
||||
sql = sql.Replace("@user", Environment.UserName)
|
||||
ClassDatabase.Execute_non_Query(sql)
|
||||
If Not USER_GUID Is Nothing Then
|
||||
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE = 'Global-Indexer'"
|
||||
ClassDatabase.Execute_non_Query(sql)
|
||||
End If
|
||||
End If
|
||||
ClassWindowLocation.SaveFormLocationSize(Me)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
If Not USER_GUID Is Nothing Then
|
||||
Unregister_Hotkeys()
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
Sub Refresh_Licence()
|
||||
Try
|
||||
Me._lizenzManager = New ClassLicenseManager("#DigitalData35452!#", "")
|
||||
Dim sql As String = "SELECT LICENSEKEY FROM TBGI_CONFIGURATION WHERE GUID = 1"
|
||||
|
||||
Dim lic As String = ClassDatabase.Execute_Scalar(sql, MyConnectionString)
|
||||
Dim licString = Me._lizenzManager.DecodeLicenseKey(lic)
|
||||
Dim split() = licString.ToString.Split("#")
|
||||
|
||||
If lic <> "" Then
|
||||
License_Anzahl = split(0)
|
||||
Else
|
||||
License_Anzahl = 0
|
||||
End If
|
||||
If CDate(split(1)) < CDate(Now.ToShortDateString) Then
|
||||
MsgBox("Ihre Lizenz ist abgelaufen!" & vbNewLine & "Letztes Gültigkeitsdatum: " & split(1) & vbNewLine & "Bitte setzen Sie sich mit Digital Data in Verbindung", MsgBoxStyle.Exclamation)
|
||||
License_Expired = True
|
||||
License_Anzahl = 0
|
||||
End If
|
||||
|
||||
'tslblLicenses.Text = "Anzahl Lizenzen: " & licenseanzahl
|
||||
LicenseProfiles = split(2)
|
||||
If My.Settings.AppTerminate = False Then
|
||||
Try
|
||||
LicenseHotKey = split(3)
|
||||
Catch ex As Exception
|
||||
LicenseHotKey = 0
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub frmStart_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
'Me.TransparencyKey = Color.Transparent
|
||||
' Me.BackColor = Color.Transparent
|
||||
Try
|
||||
Me.Opacity = 30
|
||||
ClassWindowLocation.LoadFormLocationSize(Me)
|
||||
Dim sql = sql_UserID
|
||||
sql = sql.Replace("@user", Environment.UserName)
|
||||
ClassLogger.Init("", "log_" & Environment.UserName)
|
||||
ClassLogger.Add(">> Programmstart: " & Now, False)
|
||||
ClassLogger.Add(">> Username: " & Environment.UserName, False)
|
||||
LoadMyConfig()
|
||||
If LoadFileExclusion() = False Then
|
||||
MsgBox("Dies Ausschlusskriterien für Dateien in Folderwatch konnten nicht angelegt werden!", MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
If MyConnectionString = String.Empty Then
|
||||
frmConfig_Basic.ShowDialog()
|
||||
End If
|
||||
If ClassDatabase.Init() = False Then
|
||||
ERROR_STATE = "FAILED CONNECTION"
|
||||
MsgBox("Es konnte keine Datenbankverbindung aufgebaut werden!" & vbNewLine & "Bitte prüfen Sie die Konfiguration der Datenbankverbindung und ggfls. den Datenbankserver", MsgBoxStyle.Critical)
|
||||
frmConfig_Basic.ShowDialog()
|
||||
End If
|
||||
If ClassDatabase.Init() = False Then
|
||||
ClassLogger.Add(" >> Global Indexer wird geschlossen!", False)
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
End If
|
||||
If MyConnectionString = String.Empty Then
|
||||
ClassLogger.Add(" >> Kein Connection-String definiert - Global Indexer wird geschlossen!", False)
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
End If
|
||||
USER_GUID = ClassDatabase.Execute_Scalar(sql, MyConnectionString)
|
||||
If USER_GUID Is Nothing Then
|
||||
ClassLogger.Add(" - ACHTUNG: User '" & Environment.UserName & "' nicht in der Userverwaltung hinterlegt!", False)
|
||||
MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
ClassLogger.Add(" >> Global Indexer wird geschlossen!", False)
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
Else
|
||||
Refresh_Licence()
|
||||
CURRENT_USERID = USER_GUID
|
||||
If UniversalViewer = String.Empty And My.Settings.DoNot_Show_Documents = False Then
|
||||
ERROR_STATE = "NO UV"
|
||||
frmConfig_Basic.ShowDialog()
|
||||
End If
|
||||
|
||||
|
||||
'Die FolderWatch starten
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
Dim folderwatch_SCAN = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
If Not folderwatch Is Nothing Then
|
||||
CURRENT_FOLDERWATCH = folderwatch
|
||||
If FW_started = True Then
|
||||
tslblFW.Visible = True
|
||||
ClassFolderWatcher.StartStop_FolderWatch()
|
||||
End If
|
||||
End If
|
||||
If Not folderwatch_SCAN Is Nothing Then
|
||||
CURRENT_SCAN_FOLDERWATCH = folderwatch_SCAN
|
||||
If FWSCAN_started = True Then
|
||||
tslblFW.Visible = True
|
||||
ClassFolderWatcher.StartStop_FolderWatchSCAN()
|
||||
End If
|
||||
End If
|
||||
If CURRENT_FOLDERWATCH <> "" Or CURRENT_SCAN_FOLDERWATCH <> "" Then
|
||||
TimerFolderWatch.Start()
|
||||
End If
|
||||
sql = "SELECT MODULE_GI FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('@user'))"
|
||||
sql = sql.Replace("@user", Environment.UserName)
|
||||
If ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) = False Then
|
||||
ClassLogger.Add(" - User: " & Environment.UserName & " nicht für Modul freigegben!", False)
|
||||
MsgBox("Achtung: Sie sind nicht für die Nutzung dieses Moduls freigeschaltet." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
Else
|
||||
'Am System anmelden
|
||||
sql = sql_User_Login
|
||||
sql = sql.Replace("@LogInOut", 1)
|
||||
sql = sql.Replace("@ANGEMELDETWO", Environment.MachineName)
|
||||
sql = sql.Replace("@user", Environment.UserName)
|
||||
If ClassDatabase.Execute_non_Query(sql, True) = False Then
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
End If
|
||||
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE= 'Global-Indexer'"
|
||||
ClassLogger.Add("", False)
|
||||
If START_INCOMPLETE = False Then
|
||||
Dim sql = "UPDATE TBDD_USER SET LOGGED_IN = 0, LOGGED_WHERE = '' WHERE LOWER(USERNAME) = LOWER('" & Environment.UserName & "')"
|
||||
If ClassDatabase.Execute_non_Query(sql, True) = True Then
|
||||
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & CURRENT_USERID & " AND UPPER(MODULE) = UPPER('Global-Indexer')"
|
||||
If ClassDatabase.Execute_non_Query(sql, True) = True Then
|
||||
|
||||
End If
|
||||
|
||||
|
||||
sql = "INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,MODULE) VALUES (" & USER_GUID & ",'Global-Indexer')"
|
||||
ClassDatabase.Execute_non_Query(sql, True)
|
||||
|
||||
sql = "SELECT GI_ADMIN FROM TBDD_USER WHERE GUID = " & USER_GUID
|
||||
ISUserAdmin = ClassDatabase.Execute_Scalar(sql, MyConnectionString)
|
||||
|
||||
If ISUserAdmin = True Then
|
||||
ToolStripSeparator1.Visible = True
|
||||
AdministrationToolStripMenuItem.Visible = True
|
||||
Else
|
||||
ToolStripSeparator1.Visible = False
|
||||
AdministrationToolStripMenuItem.Visible = False
|
||||
End If
|
||||
'Lizenz abgellaufen, überprüfen ob User Admin ist
|
||||
If License_Expired And ISUserAdmin = False Then
|
||||
' wenn ja dann schliessen
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
Else
|
||||
'ansonsten timer starten
|
||||
TimerClose3Minutes.Start()
|
||||
End If
|
||||
'Anzahl der eingeloggten User
|
||||
UserLoggedin = ClassDatabase.Execute_Scalar("select count(*) from TBDD_USER_MODULE_LOG_IN where MODULE = 'Global-Indexer'", MyConnectionString, True)
|
||||
If License_Anzahl < UserLoggedin Then
|
||||
MsgBox("Die Anzahl der aktuell angemeldeten User (" & UserLoggedin.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & License_Anzahl.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
ClassLogger.Add(" >> Die Anzahl der aktuell angemeldeten User (" & UserLoggedin.ToString & ") überschreitet die Anzahl der Lizenzen (" & License_Anzahl & ") für Process-Manager!", False)
|
||||
If ISUserAdmin = False Then
|
||||
'Anmeldung wieder herausnehmen
|
||||
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_GUID & " AND MODULE= 'Global-Indexer'"
|
||||
ClassDatabase.Execute_non_Query(sql, True)
|
||||
ClassLogger.Add(" - Wieder abgemeldet", False)
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
Else
|
||||
'ansonsten timer starten
|
||||
If TimerClose3Minutes.Enabled = False Then
|
||||
TimerClose3Minutes.Start()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
sql = "SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE MODULE = 'Global-Indexer'"
|
||||
Dim anzahl = ClassDatabase.Execute_Scalar(sql, MyConnectionString)
|
||||
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Anzahl Angemeldete User: " & anzahl.ToString, False)
|
||||
If Load_BasicConfig() = False Then
|
||||
START_INCOMPLETE = True
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
ClassWindowLocation.SaveFormLocationSize(Me)
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Closing Application: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
If CURRENT_USERID > 0 Then
|
||||
Unregister_Hotkeys()
|
||||
End If
|
||||
'TempDateien löschen
|
||||
Try
|
||||
For Each _file In TEMP_FILES
|
||||
System.IO.File.Delete(_file)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub New()
|
||||
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub frmStart_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If My.Settings.AppTerminate = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
'Me.TransparencyKey = Color.Transparent
|
||||
' Me.BackColor = Color.Transparent
|
||||
Cursor = Cursors.WaitCursor
|
||||
' My.Application.ChangeUICulture("en")
|
||||
'My.Application.ChangeCulture("en")
|
||||
Dim i = My.Application.UICulture.ToString()
|
||||
|
||||
Try
|
||||
|
||||
|
||||
'Dim sql = sql_UserID
|
||||
|
||||
Dim splash As New frmSplash()
|
||||
splash.ShowDialog()
|
||||
|
||||
'Lizenz abgellaufen, überprüfen ob User Admin ist
|
||||
If LICENSE_COUNT < UserLoggedin Then
|
||||
If CURRENT_USER_IS_ADMIN = True Then
|
||||
ClassLogger.Add(">> User is Admin - Timer will be started", False)
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Sie haben nun 3 Minuten Zeit eine neue Lizenz zu vergeben!", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("You now got 3 minutes to update the license!", MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
'Timer starten
|
||||
If TimerClose3Minutes.Enabled = False Then
|
||||
TimerClose3Minutes.Start()
|
||||
End If
|
||||
Unregister_Hotkeys()
|
||||
Load_Hotkeys()
|
||||
End If
|
||||
End If
|
||||
If DOCTYPE_COUNT_ACTUAL > LICENSE_DOCTYPE_COUNT Then
|
||||
If CURRENT_USER_IS_ADMIN = True Then
|
||||
ClassLogger.Add(">> User is Admin - Timer will be started", False)
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Sie haben nun 3 Minuten Zeit eine neue Lizenz zu vergeben!", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("You now got 3 minutes to update the license!", MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
'Timer starten
|
||||
If TimerClose3Minutes.Enabled = False Then
|
||||
TimerClose3Minutes.Start()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If CURRENT_USER_IS_ADMIN = True Then
|
||||
ToolStripSeparator1.Visible = True
|
||||
AdministrationToolStripMenuItem.Visible = True
|
||||
Else
|
||||
ToolStripSeparator1.Visible = False
|
||||
AdministrationToolStripMenuItem.Visible = False
|
||||
End If
|
||||
ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True)
|
||||
Unregister_Hotkeys()
|
||||
Load_Hotkeys()
|
||||
Me.Opacity = 30
|
||||
|
||||
'tslblCultureInfo.Text = "Culture/Language: " & USER_LANGUAGE
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Load-Form" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
Cursor = Cursors.Default
|
||||
End Sub
|
||||
Sub Start_Folderwatch()
|
||||
If CURRENT_FOLDERWATCH <> "" Or CURRENT_SCAN_FOLDERWATCH <> "" Then
|
||||
If FW_ISSTARTED = True Then
|
||||
tslblFW.Visible = True
|
||||
Else
|
||||
tslblFW.Visible = False
|
||||
End If
|
||||
If TimerFolderWatch.Enabled = False Then
|
||||
TimerFolderWatch.Start()
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Sub Unregister_Hotkeys()
|
||||
Try
|
||||
@@ -395,7 +491,7 @@ Public Class frmStart
|
||||
sql = "delete from TBHOTKEYTEMP_USER_HOTKEYS where [USER_ID] = " & CURRENT_USERID
|
||||
ClassDatabase.Execute_non_Query(sql, True)
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Unregister_Hotkeys:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
@@ -444,11 +540,15 @@ Public Class frmStart
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub HotkeyEisntellungenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HotkeyEisntellungenToolStripMenuItem.Click
|
||||
Me.Hide()
|
||||
Unregister_Hotkeys()
|
||||
frmHotKey_Add.ShowDialog()
|
||||
Load_Hotkeys()
|
||||
Me.Visible = True
|
||||
If ClassLicence.license_is_Valid = True Then
|
||||
Me.Hide()
|
||||
Unregister_Hotkeys()
|
||||
frmHotKey_Add.ShowDialog()
|
||||
Load_Hotkeys()
|
||||
Me.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GlobalIndexerEinstellungenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GlobalIndexerEinstellungenToolStripMenuItem.Click
|
||||
@@ -460,15 +560,25 @@ Public Class frmStart
|
||||
Private Sub GrundeinstellungenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GrundeinstellungenToolStripMenuItem.Click
|
||||
Me.TopMost = False
|
||||
frmConfig_Basic.ShowDialog()
|
||||
'Wurde die Sprache in der Konfiguration geändert
|
||||
If LANGUAGE_CHANGED = True Then
|
||||
'Sprache anpassen
|
||||
SetLanguage()
|
||||
LANGUAGE_CHANGED = False
|
||||
End If
|
||||
Start_Folderwatch()
|
||||
Me.TopMost = True
|
||||
End Sub
|
||||
|
||||
Private Sub FrmHotkeyAddToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FrmHotkeyAddToolStripMenuItem.Click
|
||||
Me.TopMost = False
|
||||
Unregister_Hotkeys()
|
||||
frmHotkey_User.ShowDialog()
|
||||
Load_Hotkeys()
|
||||
Me.TopMost = True
|
||||
If ClassLicence.license_is_Valid = True Then
|
||||
Me.Hide()
|
||||
Unregister_Hotkeys()
|
||||
frmHotkey_User.ShowDialog()
|
||||
Load_Hotkeys()
|
||||
Me.Visible = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TimerFolderWatch_Tick(sender As Object, e As EventArgs) Handles TimerFolderWatch.Tick
|
||||
@@ -496,10 +606,10 @@ Public Class frmStart
|
||||
CURRENT_WORKFILE_GUID = row.Item("GUID")
|
||||
Open_IndexDialog()
|
||||
Else
|
||||
ClassLogger.Add(">> Datei existiert (noch) nicht - fileexists?!", False)
|
||||
ClassLogger.Add(">> file not existing - filexists!", False)
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> Datei '" & row.Item(1) & "' kann nicht exclusiv geöffnet werden - fileInUse!", False)
|
||||
ClassLogger.Add(">> file '" & row.Item(1) & "' could not be opened exclusively - fileInUse!", False)
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -514,25 +624,99 @@ Public Class frmStart
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub TimerClose3Minutes_Tick(sender As Object, e As EventArgs) Handles TimerClose3Minutes.Tick
|
||||
If License_Expired = True Or License_Anzahl < UserLoggedin Then
|
||||
MsgBox("Global Indexer wird nun geschlossen, weil keine neue Lizenzdaten eingegeben wurden!", MsgBoxStyle.Information)
|
||||
If LICENSE_EXPIRED = True Or LICENSE_COUNT < UserLoggedin Then
|
||||
If USER_LANGUAGE = "de-DE" Then
|
||||
MsgBox("Global Indexer wird nun geschlossen, weil keine neue Lizenzdaten eingegeben wurden!", MsgBoxStyle.Information)
|
||||
Else
|
||||
MsgBox("Global Indexer will now be closed, cause no new license was updated!", MsgBoxStyle.Information)
|
||||
End If
|
||||
|
||||
Me.Close()
|
||||
Else
|
||||
TimerClose3Minutes.Stop()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub frmStart_Shown(sender As Object, e As EventArgs) Handles Me.Shown
|
||||
If START_INCOMPLETE = True Then
|
||||
If My.Settings.AppTerminate = True Then
|
||||
Me.Close()
|
||||
End If
|
||||
If START_INCOMPLETE = True Then
|
||||
If LICENSE_COUNT = 0 And LICENSE_EXPIRED = True Then
|
||||
|
||||
Else
|
||||
Me.Close()
|
||||
End If
|
||||
Else
|
||||
TimerFolderWatch.Start()
|
||||
End If
|
||||
If UniversalViewer_Path = String.Empty And My.Settings.DoNot_Show_Documents = False Then
|
||||
ERROR_STATE = "NO UV"
|
||||
Me.TopMost = False
|
||||
frmConfig_Basic.ShowDialog()
|
||||
Me.TopMost = True
|
||||
End If
|
||||
loaded = True
|
||||
Opacity = 0.65
|
||||
TimerFolderWatch.Start()
|
||||
End Sub
|
||||
|
||||
'Sprache anpassen
|
||||
SetLanguage()
|
||||
Start_Folderwatch()
|
||||
ClassWindowLocation.LoadFormLocationSize(Me)
|
||||
End Sub
|
||||
Private Sub HistoryIndexierteDateienToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HistoryIndexierteDateienToolStripMenuItem.Click
|
||||
frmHistory.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub InfoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles InfoToolStripMenuItem.Click
|
||||
Me.TopMost = False
|
||||
AboutBox1.ShowDialog()
|
||||
Me.TopMost = True
|
||||
End Sub
|
||||
|
||||
Private Sub frmStart_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TimerCheckDroppedFiles_Tick(sender As Object, e As EventArgs) Handles TimerCheckDroppedFiles.Tick
|
||||
TimerCheckDroppedFiles.Stop()
|
||||
Check_Dropped_Files()
|
||||
End Sub
|
||||
Private Sub LabelControl1_DragDrop(sender As Object, e As DragEventArgs) Handles LabelControl1.DragDrop, btnChoosefiles.DragDrop
|
||||
If ClassDragDrop.Drop_File(e) = True Then
|
||||
TimerCheckDroppedFiles.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LabelControl1_DragEnter(sender As Object, e As DragEventArgs) Handles LabelControl1.DragEnter, btnChoosefiles.DragEnter
|
||||
Drag_Enter(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub btnChoosefiles_Click(sender As Object, e As EventArgs) Handles btnChoosefiles.Click
|
||||
Try
|
||||
Dim openFileDialog1 As New OpenFileDialog
|
||||
Dim fName As String
|
||||
'openFileDialog1.InitialDirectory = "c:\"
|
||||
'openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
|
||||
'openFileDialog1.FilterIndex = 2
|
||||
|
||||
openFileDialog1.RestoreDirectory = True
|
||||
|
||||
openFileDialog1.Multiselect = True
|
||||
|
||||
If openFileDialog1.ShowDialog() = DialogResult.OK Then
|
||||
Dim i As Integer = 0
|
||||
ClassDragDrop.files_dropped = Nothing
|
||||
For Each fName In openFileDialog1.FileNames
|
||||
ReDim Preserve ClassDragDrop.files_dropped(i)
|
||||
ClassLogger.Add(">> Chosen File: " & fName, False)
|
||||
ClassDragDrop.files_dropped(i) = "@DROPFROMFSYSTEM@" & fName
|
||||
i += 1
|
||||
Next
|
||||
TimerCheckDroppedFiles.Start()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Choose Files for Indexing:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user