bsp; Get Return _share.GetPropertyValue("Status").ToString End Get End Property
'''''''''''' ----------------------------------------------------------------------------- '''''''''''' <summary> '''''''''''' Gets the share type. '''''''''''' </summary> '''''''''''' <history> '''''''''''' [Eduardo Morcillo] 11/08/2004 Created '''''''''''' </history> '''''''''''' ----------------------------------------------------------------------------- Public ReadOnly Property Type() As ShareType Get
Dim typeValue64 As Long = Convert.ToInt64(_share.GetPropertyValue("Type"), CultureInfo.InvariantCulture) Dim typeValue32 As Integer
If (typeValue64 And &H80000000) > 0 Then typeValue32 = &H80000000 Or Convert.ToInt32(typeValue64 And &H7FFFFFFF, CultureInfo.InvariantCulture) Else typeValue32 = Convert.ToInt32(typeValue64, CultureInfo.InvariantCulture) End If
Return CType(typeValue32, ShareType)
End Get End Property
'''''''''''' ----------------------------------------------------------------------------- '''''''''''' <summary> '''''''''''' Creates a shared folder in the local computer. '''''''''''' </summary> '''''''''''' <history> '''''''''''' [Eduardo Morcillo] 11/08/2004 Created '''''''''''' </history> '''''''''''' ----------------------------------------------------------------------------- Public Shared Function Create( _ ByVal path As String, _ ByVal name As String) As NetShare
'''''''''''' ----------------------------------------------------------------------------- '''''''''''' <summary> '''''''''''' Creates a shared folder in the local computer. '''''''''''' </summary> '''''''''''' <history> '''''''''''' [Eduardo Morcillo] 11/08/2004 Created '''''''''''' </history> '''''''''''' ----------------------------------------------------------------------------- Public Shared Function Create( _ ByVal path As String, _ ByVal name As String, _ ByVal password As String) As NetShare
'''''''''''' ----------------------------------------------------------------------------- '''''''''''' <summary> '''''''''''' Creates a shared folder in the local computer. '''''''''''' </summary> '''''''''''' <history> '''''''''''' [Eduardo Morcillo] 11/08/2004 Created '''''''''''' </history> '''''''''''' ----------------------------------------------------------------------------- Public Shared Function Create( _ ByVal path As String, _ ByVal type As ShareType, _ ByVal name As String, _ ByVal maximumAllowed As Integer, _ ByVal description As String, _ ByVal password As String) As NetShare
'''''''''''' ----------------------------------------------------------------------------- '''''''''''' <summary> '''''''''''' Creates a shared resource in the specified computer. '''''''''''' </summary> '''''''''''' <history> '''''''''''' [Eduardo Morcillo] 11/08/2004 Created '''''''''''' </history> '''''''''''' ----------------------------------------------------------------------------- Public Shared Function Create( _ ByVal computerName As String, _ ByVal path As String, _ ByVal type As ShareType, _ ByVal name As String, _ ByVal maximumAllowed As Integer, _ ByVal description As String, _ ByVal password As String) As NetShare
Dim shareClass As New System.Management.ManagementClass(String.Format("\\{0}\root\cimv2:Win32_Share", computerName)) Dim res As Integer
Try
If maximumAllowed < 0 Then
res = Convert.ToInt32( _ shareClass.InvokeMethod("Create", _ New Object() {path, name, type, Nothing,