473,583 Members | 3,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

USB Pen Drive Detection - Retrieving

To anyone who is smarter than I am when it comes to WMI:

Here is what I am trying to do:

1) Detect a USB pen drive when it is inserted
2) Retrieve the drive letter of the pen drive
3) Check for a specific folder on the pen drive

I keep receiving an error message that reads:
An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll

The detection of the USB drive is working correctly, and it calls a
method called Arrival(). Within that method I call a CheckDrive()
method that is supposed to loop through all of the logical disks and
find a removable drive that contains a specific folder. I have also
gotten a System.Executio nEngineExceptio n when the application gets to
the following line of code:

Dim moc As ManagementObjec tCollection = disks.GetInstan ces()

I have also received a "Catastroph ic Failure" message when this
same code is used in another conceptual application I wrote.

Is there a better way to do this, maybe I am going about it the wrong
way. Any help would be greatly appreciated.

Here is my code, I am using the DotNetFramework 1.1:

Imports System.Runtime. InteropServices
Imports System.Windows. Forms
Imports System.Text
Imports System.manageme nt
Imports System.IO
Public Class DetectorForm
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call
RegisterHidNoti fication()
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
'
'DetectorForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(440, 333)
Me.Name = "DetectorFo rm"
Me.Text = "DetectorFo rm"

End Sub

#End Region
Private Sub Arrival()
MsgBox("Arrival ")
CheckDrive()
End Sub

Private Sub Removal()
MsgBox("Removal ")
End Sub
Public Sub CheckDrive()
Try
Dim disks As New ManagementClass ("Win32_Logical Disk")
Dim moc As ManagementObjec tCollection =
disks.GetInstan ces()
Dim mo As ManagementObjec t
Dim DiskProperties As PropertyDataCol lection
Dim DiskProperty As PropertyData
Dim removableDisk As ManagementObjec t

'For each LogicalDisk on the Computer
For Each mo In moc
'Retrieve the disk's properties
DiskProperties = mo.Properties
'Iterate through the disk's properties
For Each DiskProperty In DiskProperties
'Check whether the particular property is defined
for this drive
If Not IsNothing(DiskP roperty.Value) Then
'Check if the drive is removable DriveType=2 -
Removable
If DiskProperty.Na me.ToString = "DriveType" _
And DiskProperty.Va lue.ToString = "2" Then
'Check if this Removable disk is a Zoom
Drive
Dim drvLetter As String
drvLetter =
mo.Properties(" DeviceId").Valu e.ToString()
'Check if a directory exists
If Directory.Exist s(drvLetter &
"chadc3322" ) Then
MsgBox("chadc33 22 Exists")
Exit For
End If
End If
End If
Next
Next mo

disks.Dispose()

Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
End Sub

Public Sub RegisterHidNoti fication()
Dim dbi As DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE = New
DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE
Dim size As Integer
size = Marshal.SizeOf( dbi)
Dim gd As Guid
' MsgBox(Marshal. SizeOf(gd))
' MsgBox(Marshal. SizeOf(New
Win32.DEV_BROAD CAST_DEVICEINTE RFACE))
dbi.dbcc_size = size
dbi.dbcc_device type = DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE
dbi.dbcc_reserv ed = 0
dbi.dbcc_classg uid = DeviceDetector. GUID_IO_MEDIA_A RRIVAL
Dim Buffer As IntPtr
Buffer = Marshal.AllocHG lobal(size)
Marshal.Structu reToPtr(dbi, Buffer, True)
Dim r As IntPtr
r = DeviceDetector. RegisterDeviceN otification(Han dle, Buffer,
DeviceDetector. DEVICE_NOTIFY_W INDOW_HANDLE)
Marshal.PtrToSt ructure(Buffer, dbi)
If r.ToInt32 = IntPtr.Zero.ToI nt32 Then
'MessageBox.Sho w(DeviceDetecto r.GetLastError( ).ToString())
End If
End Sub
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = DeviceDetector. WM_DEVICECHANGE Then
OnDeviceChange( m)
End If
MyBase.WndProc( m)
End Sub
Private Sub OnDeviceChange( ByVal msg As Message)
Dim wParam As Integer
wParam = msg.WParam.ToIn t32()
If wParam = DeviceDetector. DBT_DEVICEARRIV AL Then

Dim o As New DeviceDetector. DEV_BROADCAST_H DR
Dim b As New DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE1
Dim gd As Guid
Marshal.PtrToSt ructure(msg.LPa ram, o)
If (o.dbcc_devicet ype =
DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE) Then
Dim strsize As Integer = (o.dbcc_size - 28) / 2
ReDim b.dbcc_name(str size)
Marshal.PtrToSt ructure(msg.LPa ram, b)
Dim str As New String(b.dbcc_n ame, 0, strsize)
'************** *************** *************** ***
' Device Arrival
'************** *************** *************** ***
Arrival()
End If
ElseIf wParam = DeviceDetector. DBT_DEVICEREMOV ECOMPLETE Then
'************** *************** *************** ***
' Device Removal
'************** *************** *************** ***
Removal()
End If
End Sub
Private Class DeviceDetector
Public Const WM_DEVICECHANGE = &H219
Public Const DBT_DEVICEARRIV AL = &H8000
Public Const DBT_DEVICEREMOV ECOMPLETE = &H8004
Public Const DEVICE_NOTIFY_W INDOW_HANDLE = 0
Public Const DEVICE_NOTIFY_S ERVICE_HANDLE = 1
Public Const DBT_DEVTYP_DEVI CEINTERFACE = 5
Public Shared GUID_IO_MEDIA_A RRIVAL As Guid = New
Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED")
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_D EVICEINTERFACE
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
Public dbcc_classguid As Guid
Public dbcc_name As Short
End Class
<StructLayout(L ayoutKind.Seque ntial, CharSet:=CharSe t.Unicode)>
_
Public Class DEV_BROADCAST_D EVICEINTERFACE1
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
<MarshalAs(Unma nagedType.ByVal Array,
ArraySubType:=U nmanagedType.U1 , SizeConst:=16)> _
Public dbcc_classguid( ) As Byte
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=128) > _
Public dbcc_name() As Char
End Class
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_H DR
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
End Class
<DllImport("use r32.DLL", SetLastError:=T rue)> _
Public Shared Function _
RegisterDeviceN otification(ByV al IntPtr As IntPtr, ByVal
NotificationFil ter As IntPtr, ByVal Flags As Int32) As IntPtr
End Function
<DllImport("ker nel32.DLL")> _
Public Shared Function _
GetLastError() As Integer
End Function
End Class
End Class

Mar 3 '06 #1
8 8488
Hi,

Why dont you let the wmi tell you when the usb drive is inserted?

http://www.vb-tips.com/default.aspx?...a-07a4ef9d9504

Ken
-------------------
"Chad" <ch********@gma il.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
To anyone who is smarter than I am when it comes to WMI:

Here is what I am trying to do:

1) Detect a USB pen drive when it is inserted
2) Retrieve the drive letter of the pen drive
3) Check for a specific folder on the pen drive

I keep receiving an error message that reads:
An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll

The detection of the USB drive is working correctly, and it calls a
method called Arrival(). Within that method I call a CheckDrive()
method that is supposed to loop through all of the logical disks and
find a removable drive that contains a specific folder. I have also
gotten a System.Executio nEngineExceptio n when the application gets to
the following line of code:

Dim moc As ManagementObjec tCollection = disks.GetInstan ces()

I have also received a "Catastroph ic Failure" message when this
same code is used in another conceptual application I wrote.

Is there a better way to do this, maybe I am going about it the wrong
way. Any help would be greatly appreciated.

Here is my code, I am using the DotNetFramework 1.1:

Imports System.Runtime. InteropServices
Imports System.Windows. Forms
Imports System.Text
Imports System.manageme nt
Imports System.IO
Public Class DetectorForm
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call
RegisterHidNoti fication()
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
'
'DetectorForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(440, 333)
Me.Name = "DetectorFo rm"
Me.Text = "DetectorFo rm"

End Sub

#End Region
Private Sub Arrival()
MsgBox("Arrival ")
CheckDrive()
End Sub

Private Sub Removal()
MsgBox("Removal ")
End Sub
Public Sub CheckDrive()
Try
Dim disks As New ManagementClass ("Win32_Logical Disk")
Dim moc As ManagementObjec tCollection =
disks.GetInstan ces()
Dim mo As ManagementObjec t
Dim DiskProperties As PropertyDataCol lection
Dim DiskProperty As PropertyData
Dim removableDisk As ManagementObjec t

'For each LogicalDisk on the Computer
For Each mo In moc
'Retrieve the disk's properties
DiskProperties = mo.Properties
'Iterate through the disk's properties
For Each DiskProperty In DiskProperties
'Check whether the particular property is defined
for this drive
If Not IsNothing(DiskP roperty.Value) Then
'Check if the drive is removable DriveType=2 -
Removable
If DiskProperty.Na me.ToString = "DriveType" _
And DiskProperty.Va lue.ToString = "2" Then
'Check if this Removable disk is a Zoom
Drive
Dim drvLetter As String
drvLetter =
mo.Properties(" DeviceId").Valu e.ToString()
'Check if a directory exists
If Directory.Exist s(drvLetter &
"chadc3322" ) Then
MsgBox("chadc33 22 Exists")
Exit For
End If
End If
End If
Next
Next mo

disks.Dispose()

Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
End Sub

Public Sub RegisterHidNoti fication()
Dim dbi As DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE = New
DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE
Dim size As Integer
size = Marshal.SizeOf( dbi)
Dim gd As Guid
' MsgBox(Marshal. SizeOf(gd))
' MsgBox(Marshal. SizeOf(New
Win32.DEV_BROAD CAST_DEVICEINTE RFACE))
dbi.dbcc_size = size
dbi.dbcc_device type = DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE
dbi.dbcc_reserv ed = 0
dbi.dbcc_classg uid = DeviceDetector. GUID_IO_MEDIA_A RRIVAL
Dim Buffer As IntPtr
Buffer = Marshal.AllocHG lobal(size)
Marshal.Structu reToPtr(dbi, Buffer, True)
Dim r As IntPtr
r = DeviceDetector. RegisterDeviceN otification(Han dle, Buffer,
DeviceDetector. DEVICE_NOTIFY_W INDOW_HANDLE)
Marshal.PtrToSt ructure(Buffer, dbi)
If r.ToInt32 = IntPtr.Zero.ToI nt32 Then
'MessageBox.Sho w(DeviceDetecto r.GetLastError( ).ToString())
End If
End Sub
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = DeviceDetector. WM_DEVICECHANGE Then
OnDeviceChange( m)
End If
MyBase.WndProc( m)
End Sub
Private Sub OnDeviceChange( ByVal msg As Message)
Dim wParam As Integer
wParam = msg.WParam.ToIn t32()
If wParam = DeviceDetector. DBT_DEVICEARRIV AL Then

Dim o As New DeviceDetector. DEV_BROADCAST_H DR
Dim b As New DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE1
Dim gd As Guid
Marshal.PtrToSt ructure(msg.LPa ram, o)
If (o.dbcc_devicet ype =
DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE) Then
Dim strsize As Integer = (o.dbcc_size - 28) / 2
ReDim b.dbcc_name(str size)
Marshal.PtrToSt ructure(msg.LPa ram, b)
Dim str As New String(b.dbcc_n ame, 0, strsize)
'************** *************** *************** ***
' Device Arrival
'************** *************** *************** ***
Arrival()
End If
ElseIf wParam = DeviceDetector. DBT_DEVICEREMOV ECOMPLETE Then
'************** *************** *************** ***
' Device Removal
'************** *************** *************** ***
Removal()
End If
End Sub
Private Class DeviceDetector
Public Const WM_DEVICECHANGE = &H219
Public Const DBT_DEVICEARRIV AL = &H8000
Public Const DBT_DEVICEREMOV ECOMPLETE = &H8004
Public Const DEVICE_NOTIFY_W INDOW_HANDLE = 0
Public Const DEVICE_NOTIFY_S ERVICE_HANDLE = 1
Public Const DBT_DEVTYP_DEVI CEINTERFACE = 5
Public Shared GUID_IO_MEDIA_A RRIVAL As Guid = New
Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED")
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_D EVICEINTERFACE
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
Public dbcc_classguid As Guid
Public dbcc_name As Short
End Class
<StructLayout(L ayoutKind.Seque ntial, CharSet:=CharSe t.Unicode)>
_
Public Class DEV_BROADCAST_D EVICEINTERFACE1
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
<MarshalAs(Unma nagedType.ByVal Array,
ArraySubType:=U nmanagedType.U1 , SizeConst:=16)> _
Public dbcc_classguid( ) As Byte
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=128) > _
Public dbcc_name() As Char
End Class
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_H DR
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
End Class
<DllImport("use r32.DLL", SetLastError:=T rue)> _
Public Shared Function _
RegisterDeviceN otification(ByV al IntPtr As IntPtr, ByVal
NotificationFil ter As IntPtr, ByVal Flags As Int32) As IntPtr
End Function
<DllImport("ker nel32.DLL")> _
Public Shared Function _
GetLastError() As Integer
End Function
End Class
End Class

Mar 4 '06 #2
Hi,

You are getting the error with your code because you are calling the
wmi from the wrong thread. Use control.invoke to get the wmi call on the
right thread.

Ken
--------------------------

"Ken Tucker [MVP]" wrote:
Hi,

Why dont you let the wmi tell you when the usb drive is inserted?

http://www.vb-tips.com/default.aspx?...a-07a4ef9d9504

Ken
-------------------
"Chad" <ch********@gma il.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
To anyone who is smarter than I am when it comes to WMI:

Here is what I am trying to do:

1) Detect a USB pen drive when it is inserted
2) Retrieve the drive letter of the pen drive
3) Check for a specific folder on the pen drive

I keep receiving an error message that reads:
An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll

The detection of the USB drive is working correctly, and it calls a
method called Arrival(). Within that method I call a CheckDrive()
method that is supposed to loop through all of the logical disks and
find a removable drive that contains a specific folder. I have also
gotten a System.Executio nEngineExceptio n when the application gets to
the following line of code:

Dim moc As ManagementObjec tCollection = disks.GetInstan ces()

I have also received a "Catastroph ic Failure" message when this
same code is used in another conceptual application I wrote.

Is there a better way to do this, maybe I am going about it the wrong
way. Any help would be greatly appreciated.

Here is my code, I am using the DotNetFramework 1.1:

Imports System.Runtime. InteropServices
Imports System.Windows. Forms
Imports System.Text
Imports System.manageme nt
Imports System.IO
Public Class DetectorForm
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call
RegisterHidNoti fication()
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
'
'DetectorForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(440, 333)
Me.Name = "DetectorFo rm"
Me.Text = "DetectorFo rm"

End Sub

#End Region
Private Sub Arrival()
MsgBox("Arrival ")
CheckDrive()
End Sub

Private Sub Removal()
MsgBox("Removal ")
End Sub
Public Sub CheckDrive()
Try
Dim disks As New ManagementClass ("Win32_Logical Disk")
Dim moc As ManagementObjec tCollection =
disks.GetInstan ces()
Dim mo As ManagementObjec t
Dim DiskProperties As PropertyDataCol lection
Dim DiskProperty As PropertyData
Dim removableDisk As ManagementObjec t

'For each LogicalDisk on the Computer
For Each mo In moc
'Retrieve the disk's properties
DiskProperties = mo.Properties
'Iterate through the disk's properties
For Each DiskProperty In DiskProperties
'Check whether the particular property is defined
for this drive
If Not IsNothing(DiskP roperty.Value) Then
'Check if the drive is removable DriveType=2 -
Removable
If DiskProperty.Na me.ToString = "DriveType" _
And DiskProperty.Va lue.ToString = "2" Then
'Check if this Removable disk is a Zoom
Drive
Dim drvLetter As String
drvLetter =
mo.Properties(" DeviceId").Valu e.ToString()
'Check if a directory exists
If Directory.Exist s(drvLetter &
"chadc3322" ) Then
MsgBox("chadc33 22 Exists")
Exit For
End If
End If
End If
Next
Next mo

disks.Dispose()

Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
End Sub

Public Sub RegisterHidNoti fication()
Dim dbi As DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE = New
DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE
Dim size As Integer
size = Marshal.SizeOf( dbi)
Dim gd As Guid
' MsgBox(Marshal. SizeOf(gd))
' MsgBox(Marshal. SizeOf(New
Win32.DEV_BROAD CAST_DEVICEINTE RFACE))
dbi.dbcc_size = size
dbi.dbcc_device type = DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE
dbi.dbcc_reserv ed = 0
dbi.dbcc_classg uid = DeviceDetector. GUID_IO_MEDIA_A RRIVAL
Dim Buffer As IntPtr
Buffer = Marshal.AllocHG lobal(size)
Marshal.Structu reToPtr(dbi, Buffer, True)
Dim r As IntPtr
r = DeviceDetector. RegisterDeviceN otification(Han dle, Buffer,
DeviceDetector. DEVICE_NOTIFY_W INDOW_HANDLE)
Marshal.PtrToSt ructure(Buffer, dbi)
If r.ToInt32 = IntPtr.Zero.ToI nt32 Then
'MessageBox.Sho w(DeviceDetecto r.GetLastError( ).ToString())
End If
End Sub
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = DeviceDetector. WM_DEVICECHANGE Then
OnDeviceChange( m)
End If
MyBase.WndProc( m)
End Sub
Private Sub OnDeviceChange( ByVal msg As Message)
Dim wParam As Integer
wParam = msg.WParam.ToIn t32()
If wParam = DeviceDetector. DBT_DEVICEARRIV AL Then

Dim o As New DeviceDetector. DEV_BROADCAST_H DR
Dim b As New DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE1
Dim gd As Guid
Marshal.PtrToSt ructure(msg.LPa ram, o)
If (o.dbcc_devicet ype =
DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE) Then
Dim strsize As Integer = (o.dbcc_size - 28) / 2
ReDim b.dbcc_name(str size)
Marshal.PtrToSt ructure(msg.LPa ram, b)
Dim str As New String(b.dbcc_n ame, 0, strsize)
'************** *************** *************** ***
' Device Arrival
'************** *************** *************** ***
Arrival()
End If
ElseIf wParam = DeviceDetector. DBT_DEVICEREMOV ECOMPLETE Then
'************** *************** *************** ***
' Device Removal
'************** *************** *************** ***
Removal()
End If
End Sub
Private Class DeviceDetector
Public Const WM_DEVICECHANGE = &H219
Public Const DBT_DEVICEARRIV AL = &H8000
Public Const DBT_DEVICEREMOV ECOMPLETE = &H8004
Public Const DEVICE_NOTIFY_W INDOW_HANDLE = 0
Public Const DEVICE_NOTIFY_S ERVICE_HANDLE = 1
Public Const DBT_DEVTYP_DEVI CEINTERFACE = 5
Public Shared GUID_IO_MEDIA_A RRIVAL As Guid = New
Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED")
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_D EVICEINTERFACE
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
Public dbcc_classguid As Guid
Public dbcc_name As Short
End Class
<StructLayout(L ayoutKind.Seque ntial, CharSet:=CharSe t.Unicode)>
_
Public Class DEV_BROADCAST_D EVICEINTERFACE1
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
<MarshalAs(Unma nagedType.ByVal Array,
ArraySubType:=U nmanagedType.U1 , SizeConst:=16)> _
Public dbcc_classguid( ) As Byte
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=128) > _
Public dbcc_name() As Char
End Class
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_H DR
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
End Class
<DllImport("use r32.DLL", SetLastError:=T rue)> _
Public Shared Function _
RegisterDeviceN otification(ByV al IntPtr As IntPtr, ByVal
NotificationFil ter As IntPtr, ByVal Flags As Int32) As IntPtr
End Function
<DllImport("ker nel32.DLL")> _
Public Shared Function _
GetLastError() As Integer
End Function
End Class
End Class


Mar 4 '06 #3
That VB Tips website is so full of bugs & the code examples don't compile.
Take the webcam capture example: In the click event of button 1, it hasn't a
correct API signature for it

As for clicking a slow opening VB tip, then click the LINKS option on the
left & it shows a tip & the links. If you click back on the tips then you
get two tips.

The site was written by someone who 1) cannot write VB (so-called MVP's) &
2) has no concept of ASPX coding

A MVP should effectively know what they are talking about, but this site
demonstrates that these two people obviously don't


"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
Hi,

Why dont you let the wmi tell you when the usb drive is inserted?

http://www.vb-tips.com/default.aspx?...a-07a4ef9d9504
Ken
-------------------
"Chad" <ch********@gma il.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
To anyone who is smarter than I am when it comes to WMI:

Here is what I am trying to do:

1) Detect a USB pen drive when it is inserted
2) Retrieve the drive letter of the pen drive
3) Check for a specific folder on the pen drive

I keep receiving an error message that reads:
An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll

The detection of the USB drive is working correctly, and it calls a
method called Arrival(). Within that method I call a CheckDrive()
method that is supposed to loop through all of the logical disks and
find a removable drive that contains a specific folder. I have also
gotten a System.Executio nEngineExceptio n when the application gets to
the following line of code:

Dim moc As ManagementObjec tCollection = disks.GetInstan ces()

I have also received a "Catastroph ic Failure" message when this
same code is used in another conceptual application I wrote.

Is there a better way to do this, maybe I am going about it the wrong
way. Any help would be greatly appreciated.

Here is my code, I am using the DotNetFramework 1.1:

Imports System.Runtime. InteropServices
Imports System.Windows. Forms
Imports System.Text
Imports System.manageme nt
Imports System.IO
Public Class DetectorForm
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call
RegisterHidNoti fication()
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
'
'DetectorForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(440, 333)
Me.Name = "DetectorFo rm"
Me.Text = "DetectorFo rm"

End Sub

#End Region
Private Sub Arrival()
MsgBox("Arrival ")
CheckDrive()
End Sub

Private Sub Removal()
MsgBox("Removal ")
End Sub
Public Sub CheckDrive()
Try
Dim disks As New ManagementClass ("Win32_Logical Disk")
Dim moc As ManagementObjec tCollection =
disks.GetInstan ces()
Dim mo As ManagementObjec t
Dim DiskProperties As PropertyDataCol lection
Dim DiskProperty As PropertyData
Dim removableDisk As ManagementObjec t

'For each LogicalDisk on the Computer
For Each mo In moc
'Retrieve the disk's properties
DiskProperties = mo.Properties
'Iterate through the disk's properties
For Each DiskProperty In DiskProperties
'Check whether the particular property is defined
for this drive
If Not IsNothing(DiskP roperty.Value) Then
'Check if the drive is removable DriveType=2 -
Removable
If DiskProperty.Na me.ToString = "DriveType" _
And DiskProperty.Va lue.ToString = "2" Then
'Check if this Removable disk is a Zoom
Drive
Dim drvLetter As String
drvLetter =
mo.Properties(" DeviceId").Valu e.ToString()
'Check if a directory exists
If Directory.Exist s(drvLetter &
"chadc3322" ) Then
MsgBox("chadc33 22 Exists")
Exit For
End If
End If
End If
Next
Next mo

disks.Dispose()

Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
End Sub

Public Sub RegisterHidNoti fication()
Dim dbi As DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE = New
DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE
Dim size As Integer
size = Marshal.SizeOf( dbi)
Dim gd As Guid
' MsgBox(Marshal. SizeOf(gd))
' MsgBox(Marshal. SizeOf(New
Win32.DEV_BROAD CAST_DEVICEINTE RFACE))
dbi.dbcc_size = size
dbi.dbcc_device type = DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE
dbi.dbcc_reserv ed = 0
dbi.dbcc_classg uid = DeviceDetector. GUID_IO_MEDIA_A RRIVAL
Dim Buffer As IntPtr
Buffer = Marshal.AllocHG lobal(size)
Marshal.Structu reToPtr(dbi, Buffer, True)
Dim r As IntPtr
r = DeviceDetector. RegisterDeviceN otification(Han dle, Buffer,
DeviceDetector. DEVICE_NOTIFY_W INDOW_HANDLE)
Marshal.PtrToSt ructure(Buffer, dbi)
If r.ToInt32 = IntPtr.Zero.ToI nt32 Then
'MessageBox.Sho w(DeviceDetecto r.GetLastError( ).ToString())
End If
End Sub
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = DeviceDetector. WM_DEVICECHANGE Then
OnDeviceChange( m)
End If
MyBase.WndProc( m)
End Sub
Private Sub OnDeviceChange( ByVal msg As Message)
Dim wParam As Integer
wParam = msg.WParam.ToIn t32()
If wParam = DeviceDetector. DBT_DEVICEARRIV AL Then

Dim o As New DeviceDetector. DEV_BROADCAST_H DR
Dim b As New DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE1
Dim gd As Guid
Marshal.PtrToSt ructure(msg.LPa ram, o)
If (o.dbcc_devicet ype =
DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE) Then
Dim strsize As Integer = (o.dbcc_size - 28) / 2
ReDim b.dbcc_name(str size)
Marshal.PtrToSt ructure(msg.LPa ram, b)
Dim str As New String(b.dbcc_n ame, 0, strsize)
'************** *************** *************** ***
' Device Arrival
'************** *************** *************** ***
Arrival()
End If
ElseIf wParam = DeviceDetector. DBT_DEVICEREMOV ECOMPLETE Then
'************** *************** *************** ***
' Device Removal
'************** *************** *************** ***
Removal()
End If
End Sub
Private Class DeviceDetector
Public Const WM_DEVICECHANGE = &H219
Public Const DBT_DEVICEARRIV AL = &H8000
Public Const DBT_DEVICEREMOV ECOMPLETE = &H8004
Public Const DEVICE_NOTIFY_W INDOW_HANDLE = 0
Public Const DEVICE_NOTIFY_S ERVICE_HANDLE = 1
Public Const DBT_DEVTYP_DEVI CEINTERFACE = 5
Public Shared GUID_IO_MEDIA_A RRIVAL As Guid = New
Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED")
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_D EVICEINTERFACE
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
Public dbcc_classguid As Guid
Public dbcc_name As Short
End Class
<StructLayout(L ayoutKind.Seque ntial, CharSet:=CharSe t.Unicode)>
_
Public Class DEV_BROADCAST_D EVICEINTERFACE1
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
<MarshalAs(Unma nagedType.ByVal Array,
ArraySubType:=U nmanagedType.U1 , SizeConst:=16)> _
Public dbcc_classguid( ) As Byte
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=128) > _
Public dbcc_name() As Char
End Class
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_H DR
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
End Class
<DllImport("use r32.DLL", SetLastError:=T rue)> _
Public Shared Function _
RegisterDeviceN otification(ByV al IntPtr As IntPtr, ByVal
NotificationFil ter As IntPtr, ByVal Flags As Int32) As IntPtr
End Function
<DllImport("ker nel32.DLL")> _
Public Shared Function _
GetLastError() As Integer
End Function
End Class
End Class


Mar 5 '06 #4
I still get the same error when I call using the Invoke method. I
added the following code:

'Declaring the Delegates for arrival and removal
Delegate Sub DiskArrival()
Delegate Sub DiskRemoval()

'For the calling of the Arrival and Removal Methods I modified to be
the following
Me.Invoke(New DiskArrival(Add ressOf Arrival))
Me.Invoke(New DiskRemoval(Add ressOf Removal))

I get (An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll)

Am I calling the method wrong? I have also tried invoking the
CheckDrive method the same way, and I get the same error.

Thanks

Mar 6 '06 #5
Chad,

I figured it out. When the checkdisk procedure is running the wmi
is still adding the new drive to the list. That is the reason for the error.
I tried a bunch of differnet ways but wound up adding a timer to the form.
I enable the timer in the arrive procedure. In the timer event I call the
checkdrive and disable the timer. The timer gives the wmi a chance to do its
thing.

Private Sub Arrival()
MsgBox("Arrival ")
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As
System.EventArg s) Handles Timer1.Tick
CheckDrive()
Timer1.Enabled = False
End Sub

Ken
------------------
"Chad" wrote:
I still get the same error when I call using the Invoke method. I
added the following code:

'Declaring the Delegates for arrival and removal
Delegate Sub DiskArrival()
Delegate Sub DiskRemoval()

'For the calling of the Arrival and Removal Methods I modified to be
the following
Me.Invoke(New DiskArrival(Add ressOf Arrival))
Me.Invoke(New DiskRemoval(Add ressOf Removal))

I get (An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll)

Am I calling the method wrong? I have also tried invoking the
CheckDrive method the same way, and I get the same error.

Thanks

Mar 7 '06 #6
Excellent! It works like a charm.
Thanks for your help Ken.

Chad

Mar 7 '06 #7
Instead of being a pontificating braggadocio, why don't you try and be
constructive with your criticism and offer solutions as opposed to just being
a blow hard.
--
Steve Kemp MCSE
"LOL @ The MVPs" wrote:
That VB Tips website is so full of bugs & the code examples don't compile.
Take the webcam capture example: In the click event of button 1, it hasn't a
correct API signature for it

As for clicking a slow opening VB tip, then click the LINKS option on the
left & it shows a tip & the links. If you click back on the tips then you
get two tips.

The site was written by someone who 1) cannot write VB (so-called MVP's) &
2) has no concept of ASPX coding

A MVP should effectively know what they are talking about, but this site
demonstrates that these two people obviously don't


"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
Hi,

Why dont you let the wmi tell you when the usb drive is inserted?

http://www.vb-tips.com/default.aspx?...a-07a4ef9d9504

Ken
-------------------
"Chad" <ch********@gma il.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
To anyone who is smarter than I am when it comes to WMI:

Here is what I am trying to do:

1) Detect a USB pen drive when it is inserted
2) Retrieve the drive letter of the pen drive
3) Check for a specific folder on the pen drive

I keep receiving an error message that reads:
An unhandled exception of type 'System.Executi onEngineExcepti on'
occurred in system.manageme nt.dll

The detection of the USB drive is working correctly, and it calls a
method called Arrival(). Within that method I call a CheckDrive()
method that is supposed to loop through all of the logical disks and
find a removable drive that contains a specific folder. I have also
gotten a System.Executio nEngineExceptio n when the application gets to
the following line of code:

Dim moc As ManagementObjec tCollection = disks.GetInstan ces()

I have also received a "Catastroph ic Failure" message when this
same code is used in another conceptual application I wrote.

Is there a better way to do this, maybe I am going about it the wrong
way. Any help would be greatly appreciated.

Here is my code, I am using the DotNetFramework 1.1:

Imports System.Runtime. InteropServices
Imports System.Windows. Forms
Imports System.Text
Imports System.manageme nt
Imports System.IO
Public Class DetectorForm
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call
RegisterHidNoti fication()
End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
'
'DetectorForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(440, 333)
Me.Name = "DetectorFo rm"
Me.Text = "DetectorFo rm"

End Sub

#End Region
Private Sub Arrival()
MsgBox("Arrival ")
CheckDrive()
End Sub

Private Sub Removal()
MsgBox("Removal ")
End Sub
Public Sub CheckDrive()
Try
Dim disks As New ManagementClass ("Win32_Logical Disk")
Dim moc As ManagementObjec tCollection =
disks.GetInstan ces()
Dim mo As ManagementObjec t
Dim DiskProperties As PropertyDataCol lection
Dim DiskProperty As PropertyData
Dim removableDisk As ManagementObjec t

'For each LogicalDisk on the Computer
For Each mo In moc
'Retrieve the disk's properties
DiskProperties = mo.Properties
'Iterate through the disk's properties
For Each DiskProperty In DiskProperties
'Check whether the particular property is defined
for this drive
If Not IsNothing(DiskP roperty.Value) Then
'Check if the drive is removable DriveType=2 -
Removable
If DiskProperty.Na me.ToString = "DriveType" _
And DiskProperty.Va lue.ToString = "2" Then
'Check if this Removable disk is a Zoom
Drive
Dim drvLetter As String
drvLetter =
mo.Properties(" DeviceId").Valu e.ToString()
'Check if a directory exists
If Directory.Exist s(drvLetter &
"chadc3322" ) Then
MsgBox("chadc33 22 Exists")
Exit For
End If
End If
End If
Next
Next mo

disks.Dispose()

Catch ex As Exception
MsgBox(ex.Messa ge)
End Try
End Sub

Public Sub RegisterHidNoti fication()
Dim dbi As DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE = New
DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE
Dim size As Integer
size = Marshal.SizeOf( dbi)
Dim gd As Guid
' MsgBox(Marshal. SizeOf(gd))
' MsgBox(Marshal. SizeOf(New
Win32.DEV_BROAD CAST_DEVICEINTE RFACE))
dbi.dbcc_size = size
dbi.dbcc_device type = DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE
dbi.dbcc_reserv ed = 0
dbi.dbcc_classg uid = DeviceDetector. GUID_IO_MEDIA_A RRIVAL
Dim Buffer As IntPtr
Buffer = Marshal.AllocHG lobal(size)
Marshal.Structu reToPtr(dbi, Buffer, True)
Dim r As IntPtr
r = DeviceDetector. RegisterDeviceN otification(Han dle, Buffer,
DeviceDetector. DEVICE_NOTIFY_W INDOW_HANDLE)
Marshal.PtrToSt ructure(Buffer, dbi)
If r.ToInt32 = IntPtr.Zero.ToI nt32 Then
'MessageBox.Sho w(DeviceDetecto r.GetLastError( ).ToString())
End If
End Sub
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = DeviceDetector. WM_DEVICECHANGE Then
OnDeviceChange( m)
End If
MyBase.WndProc( m)
End Sub
Private Sub OnDeviceChange( ByVal msg As Message)
Dim wParam As Integer
wParam = msg.WParam.ToIn t32()
If wParam = DeviceDetector. DBT_DEVICEARRIV AL Then

Dim o As New DeviceDetector. DEV_BROADCAST_H DR
Dim b As New DeviceDetector. DEV_BROADCAST_D EVICEINTERFACE1
Dim gd As Guid
Marshal.PtrToSt ructure(msg.LPa ram, o)
If (o.dbcc_devicet ype =
DeviceDetector. DBT_DEVTYP_DEVI CEINTERFACE) Then
Dim strsize As Integer = (o.dbcc_size - 28) / 2
ReDim b.dbcc_name(str size)
Marshal.PtrToSt ructure(msg.LPa ram, b)
Dim str As New String(b.dbcc_n ame, 0, strsize)
'************** *************** *************** ***
' Device Arrival
'************** *************** *************** ***
Arrival()
End If
ElseIf wParam = DeviceDetector. DBT_DEVICEREMOV ECOMPLETE Then
'************** *************** *************** ***
' Device Removal
'************** *************** *************** ***
Removal()
End If
End Sub
Private Class DeviceDetector
Public Const WM_DEVICECHANGE = &H219
Public Const DBT_DEVICEARRIV AL = &H8000
Public Const DBT_DEVICEREMOV ECOMPLETE = &H8004
Public Const DEVICE_NOTIFY_W INDOW_HANDLE = 0
Public Const DEVICE_NOTIFY_S ERVICE_HANDLE = 1
Public Const DBT_DEVTYP_DEVI CEINTERFACE = 5
Public Shared GUID_IO_MEDIA_A RRIVAL As Guid = New
Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED")
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_D EVICEINTERFACE
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
Public dbcc_classguid As Guid
Public dbcc_name As Short
End Class
<StructLayout(L ayoutKind.Seque ntial, CharSet:=CharSe t.Unicode)>
_
Public Class DEV_BROADCAST_D EVICEINTERFACE1
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
<MarshalAs(Unma nagedType.ByVal Array,
ArraySubType:=U nmanagedType.U1 , SizeConst:=16)> _
Public dbcc_classguid( ) As Byte
<MarshalAs(Unma nagedType.ByVal Array, SizeConst:=128) > _
Public dbcc_name() As Char
End Class
<StructLayout(L ayoutKind.Seque ntial)> _
Public Class DEV_BROADCAST_H DR
Public dbcc_size As Integer
Public dbcc_devicetype As Integer
Public dbcc_reserved As Integer
End Class
<DllImport("use r32.DLL", SetLastError:=T rue)> _
Public Shared Function _
RegisterDeviceN otification(ByV al IntPtr As IntPtr, ByVal
NotificationFil ter As IntPtr, ByVal Flags As Int32) As IntPtr
End Function
<DllImport("ker nel32.DLL")> _
Public Shared Function _
GetLastError() As Integer
End Function
End Class
End Class



Mar 28 '06 #8
Hi Chad,

I'm trying to do something very similar. Earlier in the thread Ken Tucker
asked why you don't use a WMI 'ManagementEven tWatcher' to watch for new
devices? I was wondering the same thing. Do you have a specific reason?

Chris

"Chad" wrote:
Excellent! It works like a charm.
Thanks for your help Ken.

Chad

Mar 30 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2317
by: Christopher Mouton | last post by:
We regularly make drive images of our entire server and store it at a backup site. To be honest I have never fully understood how the imaging programs deal with open files. My question is will the drive image make a good copy of MySQL DB or should I be running a mysqldump before doing the drive image?
4
25147
by: sanjana | last post by:
hi i m using the win32_diskdrive class for detecting a memory card insertion and removal..and this class detects memory card(sd card..etc) insertion removal from the device the deviceid attribute gives me \\.\PHYSICALDRIVE0 or \\.\PHYSICALDRIVE1 etc.. i m trying to get the drive name say(c: or d: ...etc)from the device
5
2292
by: Dave H | last post by:
I have an asp:listbox, allowing multiple selections, is there a quick check to see if there's more than one selected, or do I need to go through the whole list? Thanks, Dave
2
3450
by: kj7ny | last post by:
I am attempting to incrementally back up files using python. How can I compare a file on a hard drive to a file in a python created zip file to tell if the file has changed? Or should I be using some other method to determine if a file has changed?
3
2718
by: =?Utf-8?B?UHJpeWE=?= | last post by:
Hi, Could someone tell me how to retrieve a drive's drive letter from user mode given its device name? Any information is greatly appreciated. Thanks, Priya
3
1257
by: Newbie19 | last post by:
I am trying to retrieve information from a remote Network drive using Visual Basic... however I am unable to retrieve any data. I'm trying to integrate into a ASP.Net page that already runs an SQL Query to a database.
1
1033
by: Newbie19 | last post by:
I am currently making an ASP.Net application that uses SQL to pull data from a database and displays the information from the db on the page. However, I've been asked to pull information from a share drive on my network containing more information. However, I was told that VB will allow me to retrieve this data in the share drive, but I am not...
0
1910
by: origami.takarana | last post by:
Intrusion Detection Strategies ----------------------------------- Until now, we’ve primarily discussed monitoring in how it relates to intrusion detection, but there’s more to an overall intrusion detection installation than monitoring alone. Monitoring can help you spot problems in your network, as well as identify performance problems,...
10
3248
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations where you could improve the application by detecting the browser vendor/version. Some of the posters here disagreed. Since then, I've had to deal with...
0
7826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8327
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7935
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8193
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5701
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5374
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3818
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1433
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.