本文介绍了如何使用vb.net共享文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行时创建一个文件夹并授予其完全控制权,但是当我打开

高级共享标签时,我发现共享文件夹的权限是只读的。我怎么能使用Vb.Net?

I am creating a folder at runtime and giving its access to full control but when i open the
Advance Sharing Tab i found it that the permission for sharing the folder is Read only.How can i give the permission for sharing to everyone with FullControl using Vb.Net?

推荐答案

Try
Dim managementClass As New ManagementClass("Win32_Share")
Dim inParams As ManagementBaseObject = managementClass.GetMethodParameters("Create")
inParams("Description") = "My Description"
inParams("Name") = "Share Name"
inParams("Path") = "C:\My Folder"
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


这篇关于如何使用vb.net共享文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:42
查看更多