用ProcessStartInfo设置共享文件夹,但是权限是只读的,如何设置成可更改,请大家帮忙! http://www.dotnet247.com/247reference/msgs/11/56914.aspx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 问题解决private void setShare(String name, String path){ String sharename = "backupDBFile"; UInt32 ret = Create("backupDBFile", 10, sharename, "",@path); share = new ManagementObject("Win32_Share=" + "'" + sharename +"'");}public static UInt32 Create(string Description, UInt32 MaximumAllowed, string Name, string Password, string Path){ ManagementBaseObject inParams = null; ManagementClass classObj = new System.Management.ManagementClass(null, "Win32_Share", null); inParams = classObj.GetMethodParameters("Create"); inParams["Access"] = null; // default Security descriptor used inParams["Description"] = Description; inParams["MaximumAllowed"] = MaximumAllowed; inParams["Name"] = Name; inParams["Password"] = Password; inParams["Path"] = Path; inParams["Type"] = 0; // Disk drive 0, print queue 1 ManagementBaseObject outParams = classObj.InvokeMethod("Create", inParams, null); return Convert.ToUInt32(outParams.Properties["ReturnValue"].Value); } 求个LINQ看看可能求到么?关于两个dataset合并查询 C#winform 无法关闭窗体 C# 二维码源码 最好是整个程序给我 谢谢 C# SendMessage参数转换问题 “<T>”是什么意思 窗体绘图 TextureBrush的用法,请教高手。。。 bitsbird、qiuji、zeusvenus、singlepine 关于Datagrid更新问题 DataTable循环遍历次数太多(大于1万次),程序死了,也无法调试,请问怎么解决? 小问题:如何重新显示我的窗体? 急求,正则表达式 感谢先 求助
private void setShare(String name, String path)
{
String sharename = "backupDBFile";
UInt32 ret = Create("backupDBFile", 10, sharename, "",@path);
share = new ManagementObject("Win32_Share=" + "'" + sharename +"'");
}
public static UInt32 Create(string Description, UInt32 MaximumAllowed, string Name, string Password, string Path)
{
ManagementBaseObject inParams = null;
ManagementClass classObj = new System.Management.ManagementClass(null, "Win32_Share", null);
inParams = classObj.GetMethodParameters("Create");
inParams["Access"] = null; // default Security descriptor used
inParams["Description"] = Description;
inParams["MaximumAllowed"] = MaximumAllowed;
inParams["Name"] = Name;
inParams["Password"] = Password;
inParams["Path"] = Path;
inParams["Type"] = 0; // Disk drive 0, print queue 1
ManagementBaseObject outParams = classObj.InvokeMethod("Create", inParams, null);
return Convert.ToUInt32(outParams.Properties["ReturnValue"].Value);
}