Form1.vb ( File view )

  • By jinjinge 2015-03-25
  • View(s):0
  • Download(s):0
  • Point(s): 1
			Imports CbFlt
Imports System.Security.Principal
Imports System.Runtime.InteropServices

Public Class Form1
    Dim mGuid As String = "18189531-48ED-43fc-8582-E8BD2F9AB533"

    Public FilterRuleList As List(Of FilterRule)

    'CBFilterManager 
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        InitCBFilterSDK()
        UpdatDriverStaue()
        FilterRuleList = LoadFilterList()
        UpdateFilterRuleList()

    End Sub
    Private Sub UpdatDriverStaue()
        Dim Installed As Boolean = False
        Dim VersionHigh As Integer = 0, VersionLow As Integer = 0
        Dim status As SERVICE_STATUS = New SERVICE_STATUS()
        Dim strStat As String

        CallbackFilter.GetDriverStatus(mGuid, Installed, VersionHigh, VersionLow, status)

        If Installed = True Then
            Select Case status.currentState
                Case CInt(CbFltDriverState.CBFLT_SERVICE_CONTINUE_PENDING)
                    strStat = "continue is pending"
                Case CInt(CbFltDriverState.CBFLT_SERVICE_PAUSE_PENDING)
                    strStat = "pause is pending"
                Case CInt(CbFltDriverState.CBFLT_SERVICE_PAUSED)
                    strStat = "is paused"
                Case CInt(CbFltDriverState.CBFLT_SERVICE_RUNNING)
                    strStat = "is running"
                Case CInt(CbFltDriverState.CBFLT_SERVICE_START_PENDING)
                    strStat = "is starting"
                Case CInt(CbFltDriverState.CBFLT_SERVICE_STOP_PENDING)
                    strStat = "is stopping"
                Case CInt(CbFltDriverState.CBFLT_SERVICE_STOPPED)
                    strStat = "is stopped"
                Case Else
                    strStat = "in undefined state"
            End Select
            labelDriverStatus.Text = String.Format("Driver (ver {
0
}.{
1
}.{
2
}.{
3
}) installed, service {
4
}", VersionHigh >> 16, VersionHigh And &HFFFF, VersionLow >> 16, VersionLow And &HFFFF, strStat)
        Else
            labelDriverStatus.Text = String.Format("Driver is not installed")
        End If
    End Sub
   

    Private Sub btnInstallDriver_Click(sender As Object, e As EventArgs) Handles btnInstallDriver.Click
        Dim Reboot As Boolean = False
        Try
            If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
                CallbackFilter.InstallDriver(OpenFileDialog1.FileName, mGuid, Reboot)
                UpdatDriverStaue()

                If (Reboot) Then
                    MessageBox.Show("Reboot the computer for the changes to take affect", "CBFilter", MessageBoxButtons.OK, MessageBoxIcon.Information)

                Else
                    MessageBox.Show("Driver installed successfully", "CBFilter", MessageBoxButtons.OK, MessageBoxIcon.Information)
                End If

            End If
        Catch ex As Exception
        End Try
    End Sub

    Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click
        If FilterRuleList.Count = 0 Then
            MessageBox.Show("Please add one or more filter rule.")
        Else
            For Each filter As FilterRule In FilterRuleList
                filter.StartLogging()
            Next
            btnAddRule.Enabled = False
            btnDeleteRule.Enabled = False

            btnStart.Enabled = False
            btnStop.Enabled = True
        End If
    End Sub

    Private Sub btnStop_Click(sender As Object, e As EventArgs) Handles btnStop.Click
        For Each filter As FilterRule In FilterRuleList
            filter.StopLogging()
        Next
        btnAddRule.Enabled = True
        btnDeleteRule.Enabled = True
        btnStart.Enabled = True
        btnStop.Enabled = False
    End Sub

    Private Sub txtAddRule_Click(sender As Object, e As EventArgs) Handles btnAddRule.Click
        Dim addRuleFrm As New AddRule()
        addRuleFrm.ShowDialog(Me)

        If (IsNothing(addRuleFrm.filterRuleObject) = False) Then
            FilterRuleList.Add(addRuleFrm.filterRuleObject)
            SaveFilterList(FilterRuleList)
            UpdateFilterRuleList()
        End If
    End Sub

    Private Sub UpdateFilterRuleList()
        cmbFilterRuleList.Items.Clear()
        For Each filter As FilterRule In FilterRuleList
            cmbFilterRuleList.Items.Add(filter)
        Next
        If (FilterRuleList.Count > 0) Then
            cmbFilterRuleList.Enabled = True
            cmbFilterRuleList.SelectedIndex = 0
        Else
            cmbFilterRuleList.Enabled = False
        End If

    End Sub

    Private Sub cmbFilterRuleList_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbFilterRuleList.SelectedIndexChanged
        Dim filter As FilterRule
        filter = cmbFilterRuleList.SelectedItem
        If (IsNothing(filter) = False) Then
            txtDBPath.Text = filter.DBPath
            txtLogginFileMask.Text = filter.FileNameMask
            chkReadFile.Checked = filter.ChkReadFilter
            chkWriteFile.Checked = filter.ChkWriteFilter
            chkCreateFile.Checked = filter.ChkCreateFilter
            chkRenameFile.Checked = filter.ChkRenameFilter
            chkOpenFile.Checked = filter.ChkOpenFileFilter
            chkCloseFile.Checked = filter.ChkCloseFileFilter
            chkDeleteFile.Checked = filter.ChkDeleteFileFilter
            chkSetBasicInfo.Checked = filter.ChkSetBasicFilter
            chkSetScurity.Checked = filter.ChkSetBasicFilter
            chkSetSize.Checked = filter.ChkSetSizeFilter
            chkEnumerateDirectory.Checked = filter.EnumDirectoryFilter
        End If
    End Sub

    Private Sub btnDeleteRule_Click(sender As Object, e As EventArgs) Handles btnDeleteRule.Click
        Dim filter As FilterRule
        filter = cmbFilterRuleList.SelectedItem
        Dim findOtherreference As Boolean = False
        If (IsNothing(filter) = False) Then
            FilterRuleList.Remove(filter)
            UpdateFilterRuleList()
            SaveFilterList(FilterRuleList)

            For Each otherfilter As FilterRule In FilterRuleList
                If otherfilter.GetSqliteConnection() Is filter.GetSqliteConnection() Then
                    findOtherreference = True
                    Exit For
                End If
            Next

            If findOtherreference = False Then
                SqliteMan.GlobalDatabaseDictionary.Remove(filter.DBPath)
            End If
        End If

    End Sub
End Class			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.97 kB
01.97 kB
AddRule.Designer.vb15.01 kB2015-03-17 09:46
AddRule.resx5.88 kB2015-03-17 09:46
AddRule.vb2.57 kB2015-03-17 09:55
App.config1.49 kB2015-03-11 12:29
app.manifest2.79 kB2015-03-11 16:18
01.97 kB
01.97 kB
CbFlt3Net.dll153.50 kB2015-02-16 19:56
EntityFramework.dll4.96 MB2015-03-11 10:11
EntityFramework.SqlServer.dll606.70 kB2015-03-11 10:11
EntityFramework.SqlServer.xml151.24 kB2015-03-11 10:11
EntityFramework.xml3.48 MB2015-03-11 10:11
FileSystemEvetLogger.exe46.50 kB2015-03-11 16:31
FileSystemEvetLogger.exe.config1.49 kB2015-03-11 12:29
FileSystemEvetLogger.pdb63.50 kB2015-03-11 16:31
FileSystemEvetLogger.vshost.exe23.65 kB2015-03-11 16:31
FileSystemEvetLogger.vshost.exe.config1.49 kB2015-03-11 12:29
FileSystemEvetLogger.xml712.00 B2015-03-11 16:31
System.Data.SQLite.dll273.50 kB2015-03-11 10:11
System.Data.SQLite.EF6.dll181.00 kB2015-03-11 10:11
System.Data.SQLite.Linq.dll180.50 kB2015-03-11 10:11
System.Data.SQLite.xml701.41 kB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll1.12 MB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll982.50 kB2015-03-11 10:11
01.97 kB
01.97 kB
01.97 kB
EntityFramework.dll4.96 MB2015-03-11 10:11
EntityFramework.SqlServer.dll606.70 kB2015-03-11 10:11
EntityFramework.SqlServer.xml151.24 kB2015-03-11 10:11
EntityFramework.xml3.48 MB2015-03-11 10:11
FileSystemEvetLogger.exe68.00 kB2015-03-18 09:49
FileSystemEvetLogger.exe.config1.49 kB2015-03-11 12:29
FileSystemEvetLogger.pdb85.50 kB2015-03-18 09:49
FileSystemEvetLogger.vshost.exe23.65 kB2015-03-18 09:51
FileSystemEvetLogger.vshost.exe.config1.49 kB2015-03-11 12:29
FileSystemEvetLogger.vshost.exe.manifest2.79 kB2015-03-11 16:18
FileSystemEvetLogger.xml712.00 B2015-03-18 09:49
ruleSave.xml930.00 B2015-03-18 09:50
System.Data.SQLite.dll273.50 kB2015-03-11 10:11
System.Data.SQLite.EF6.dll181.00 kB2015-03-11 10:11
System.Data.SQLite.Linq.dll180.50 kB2015-03-11 10:11
System.Data.SQLite.xml701.41 kB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll1.12 MB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll982.50 kB2015-03-11 10:11
01.97 kB
01.97 kB
01.97 kB
01.97 kB
CBFilterManager.vb7.90 kB2015-03-14 18:35
FileSystemEvetLogger.vbproj9.56 kB2015-03-14 18:12
FilterRule.vb6.37 kB2015-03-18 09:49
Form1.Designer.vb16.51 kB2015-03-18 09:23
Form1.resx6.08 kB2015-03-18 09:23
Form1.vb6.45 kB2015-03-18 09:49
Form1.vb.bak6.59 kB2015-03-11 20:24
GlobalModule.vb3.44 kB2015-03-14 22:15
<My>0.00 B2015-03-14 22:27
My1.49 kB2015-03-11 12:29
My510.00 B2015-03-11 09:23
My1.17 kB2015-03-11 09:23
My2.72 kB2015-03-11 12:29
My5.48 kB2015-03-11 09:23
My2.93 kB2015-03-11 12:29
My279.00 B2015-03-11 09:23
01.97 kB
01.97 kB
DesignTimeResolveAssemblyReferences.cache1.28 kB2015-03-11 12:29
DesignTimeResolveAssemblyReferencesInput.cache8.22 kB2015-03-11 16:31
FileSystemEvetLogger.exe46.50 kB2015-03-11 16:31
FileSystemEvetLogger.Form1.resources180.00 B2015-03-11 16:22
FileSystemEvetLogger.pdb63.50 kB2015-03-11 16:31
FileSystemEvetLogger.Resources.resources180.00 B2015-03-11 16:22
FileSystemEvetLogger.vbproj.FileListAbsolute.txt4.95 kB2015-03-11 16:31
FileSystemEvetLogger.vbproj.GenerateResource.Cache977.00 B2015-03-11 12:37
FileSystemEvetLogger.vbprojResolveAssemblyReference.cache128.69 kB2015-03-11 15:05
FileSystemEvetLogger.xml712.00 B2015-03-11 16:31
01.97 kB
My7.50 kB2015-03-11 12:53
01.97 kB
01.97 kB
DesignTimeResolveAssemblyReferences.cache1.00 kB2015-03-11 15:31
DesignTimeResolveAssemblyReferencesInput.cache7.88 kB2015-03-18 09:49
FileSystemEvetLogger.AddRule.resources180.00 B2015-03-17 09:50
FileSystemEvetLogger.exe68.00 kB2015-03-18 09:49
FileSystemEvetLogger.Form1.resources180.00 B2015-03-18 09:46
FileSystemEvetLogger.pdb85.50 kB2015-03-18 09:49
FileSystemEvetLogger.Resources.resources180.00 B2015-03-14 18:12
FileSystemEvetLogger.vbproj.FileListAbsolute.txt5.15 kB2015-03-18 09:51
FileSystemEvetLogger.vbproj.GenerateResource.Cache1.01 kB2015-03-18 09:46
FileSystemEvetLogger.vbprojResolveAssemblyReference.cache67.54 kB2015-03-14 18:12
FileSystemEvetLogger.xml712.00 B2015-03-18 09:49
01.97 kB
My7.50 kB2015-03-11 15:17
01.97 kB
01.97 kB
DesignTimeResolveAssemblyReferencesInput.cache8.23 kB2015-03-11 15:17
01.97 kB
My7.50 kB2015-03-11 15:17
packages.config571.00 B2015-03-11 12:29
SqliteMan.vb3.31 kB2015-03-18 09:41
FileSystemEvetLogger.sln1.70 kB2015-03-11 15:19
FileSystemEvetLogger.v12.suo67.00 kB2015-03-18 09:51
01.97 kB
01.97 kB
01.97 kB
App.config.transform209.00 B2015-03-11 10:11
Web.config.transform209.00 B2015-03-11 10:11
EntityFramework.6.1.3.nupkg4.06 MB2015-03-11 10:11
EntityFramework.6.1.3.nuspec1.04 kB2015-03-11 10:11
01.97 kB
01.97 kB
EntityFramework.dll4.75 MB2015-03-11 10:11
EntityFramework.SqlServer.dll587.70 kB2015-03-11 10:11
EntityFramework.SqlServer.xml142.03 kB2015-03-11 10:11
EntityFramework.xml3.08 MB2015-03-11 10:11
01.97 kB
EntityFramework.dll4.96 MB2015-03-11 10:11
EntityFramework.SqlServer.dll606.70 kB2015-03-11 10:11
EntityFramework.SqlServer.xml151.24 kB2015-03-11 10:11
EntityFramework.xml3.48 MB2015-03-11 10:11
01.97 kB
about_EntityFramework.help.txt1.92 kB2015-03-11 10:11
EntityFramework.PowerShell.dll49.70 kB2015-03-11 10:11
EntityFramework.PowerShell.Utility.dll13.20 kB2015-03-11 10:11
EntityFramework.psd124.26 kB2015-03-11 10:11
EntityFramework.psm143.25 kB2015-03-11 10:11
init.ps19.80 kB2015-03-11 10:11
install.ps19.91 kB2015-03-11 10:11
migrate.exe527.70 kB2015-03-11 10:11
repositories.config139.00 B2015-03-11 10:11
01.97 kB
System.Data.SQLite.1.0.96.0.nupkg3.02 kB2015-03-11 10:11
System.Data.SQLite.1.0.96.0.nuspec1.99 kB2015-03-11 10:11
01.97 kB
01.97 kB
01.97 kB
System.Data.SQLite.Core.targets4.20 kB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll1.12 MB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll834.50 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.Core.targets4.20 kB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll1.11 MB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll882.00 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.Core.targets4.20 kB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll1.12 MB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll982.50 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.Core.targets4.20 kB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll1.12 MB2015-03-11 10:11
01.97 kB
SQLite.Interop.dll965.50 kB2015-03-11 10:11
01.97 kB
01.97 kB
System.Data.SQLite.dll284.00 kB2015-03-11 10:11
System.Data.SQLite.xml701.41 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.dll273.50 kB2015-03-11 10:11
System.Data.SQLite.xml701.41 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.dll273.50 kB2015-03-11 10:11
System.Data.SQLite.xml701.41 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.dll273.50 kB2015-03-11 10:11
System.Data.SQLite.xml701.41 kB2015-03-11 10:11
System.Data.SQLite.Core.1.0.96.0.nupkg4.97 MB2015-03-11 10:11
System.Data.SQLite.Core.1.0.96.0.nuspec883.00 B2015-03-11 10:11
01.97 kB
01.97 kB
01.97 kB
app.config.install.xdt568.00 B2015-03-11 10:11
app.config.transform464.00 B2015-03-11 10:11
web.config.install.xdt568.00 B2015-03-11 10:11
web.config.transform464.00 B2015-03-11 10:11
01.97 kB
app.config.install.xdt568.00 B2015-03-11 10:11
app.config.transform464.00 B2015-03-11 10:11
web.config.install.xdt568.00 B2015-03-11 10:11
web.config.transform464.00 B2015-03-11 10:11
01.97 kB
app.config.install.xdt568.00 B2015-03-11 10:11
app.config.transform464.00 B2015-03-11 10:11
web.config.install.xdt568.00 B2015-03-11 10:11
web.config.transform464.00 B2015-03-11 10:11
01.97 kB
01.97 kB
System.Data.SQLite.EF6.dll181.00 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.EF6.dll181.00 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.EF6.dll181.00 kB2015-03-11 10:11
System.Data.SQLite.EF6.1.0.96.0.nupkg139.89 kB2015-03-11 10:11
System.Data.SQLite.EF6.1.0.96.0.nuspec1.25 kB2015-03-11 10:11
01.97 kB
01.97 kB
install.ps1462.00 B2015-03-11 10:11
01.97 kB
install.ps1462.00 B2015-03-11 10:11
01.97 kB
install.ps1462.00 B2015-03-11 10:11
01.97 kB
01.97 kB
01.97 kB
app.config.transform398.00 B2015-03-11 10:11
web.config.transform398.00 B2015-03-11 10:11
01.97 kB
app.config.transform398.00 B2015-03-11 10:11
web.config.transform398.00 B2015-03-11 10:11
01.97 kB
app.config.transform398.00 B2015-03-11 10:11
web.config.transform398.00 B2015-03-11 10:11
01.97 kB
app.config.transform398.00 B2015-03-11 10:11
web.config.transform398.00 B2015-03-11 10:11
01.97 kB
01.97 kB
System.Data.SQLite.Linq.dll192.00 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.Linq.dll180.50 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.Linq.dll180.50 kB2015-03-11 10:11
01.97 kB
System.Data.SQLite.Linq.dll180.50 kB2015-03-11 10:11
System.Data.SQLite.Linq.1.0.96.0.nupkg180.41 kB2015-03-11 10:11
System.Data.SQLite.Linq.1.0.96.0.nuspec836.00 B2015-03-11 10:11
...
Sponsored links

Form1.vb (25.51 MB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D