24-06-19, 03:23 PM
عايز اعمل مشاركة لفولدر بس يكون متاح للكل every one permission و read and wite
انا جربت الكود ده لكن مش بيخليه ل every one
Try
Dim managementClass As New ManagementClass("Win32_Share")
Dim inParams As ManagementBaseObject = managementClass.GetMethodParameters("Create")
inParams("Description") = "My Description"
inParams("Name") = "$DATABAK$"
inParams("Path") = "D:\DATABAK"
inParams("Type") = &H0
Dim outParams As ManagementBaseObject = managementClass.InvokeMethod("Create", inParams, Nothing)
If Convert.ToUInt32(outParams.Properties("ReturnValue").Value) <> 0 Then
MessageBox.Show("Unable to share directory.")
Else
MessageBox.Show("Shared folder successfully!")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
انا جربت الكود ده لكن مش بيخليه ل every one
Try
Dim managementClass As New ManagementClass("Win32_Share")
Dim inParams As ManagementBaseObject = managementClass.GetMethodParameters("Create")
inParams("Description") = "My Description"
inParams("Name") = "$DATABAK$"
inParams("Path") = "D:\DATABAK"
inParams("Type") = &H0
Dim outParams As ManagementBaseObject = managementClass.InvokeMethod("Create", inParams, Nothing)
If Convert.ToUInt32(outParams.Properties("ReturnValue").Value) <> 0 Then
MessageBox.Show("Unable to share directory.")
Else
MessageBox.Show("Shared folder successfully!")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try