请问我想让C:\access文件夹在局域网内共享应该怎么做(用程序实现)?
在VS.net 2003下
在VS.net 2003下
解决方案 »
- C# dotnet动态为类添加属性
- 碰到个牛人
- C#缩略图问题
- 运行以下代码时,出现“方法必须具有返回类型”的错误提示
- 更新数据库中的表
- 如何将对datagridview的修改返回到数据库中?
- foreach( Control z in Controls )会遍例所有form控件,怎样才能遍例特定的控件?
- 在我的WINFORM程序中为何找不到命名空间EXCEL,系统是2000,OFFICE2003,添加了引用,MICROSOFT EXCEL 11.0 Object Library和MICROSOFT O
- 数组的内存分配
- .NET 下, windows ce 下线程如何中断?
- 不用字符串拼接的方式,如何构造带参数的sql语句字符串
- 高手们啊!十万火急!帮帮忙啊!关于LISTVIEW的显示问题
//设置共享的方法
using System;
using System.Management;
using System.Windows.Forms;namespace WMISample
{
public class CallWMIMethod
{
public static void Main()
{
try
{
ManagementClass classInstance =
new ManagementClass("root\\CIMV2", "Win32_Share", null); // Obtain in-parameters for the method
ManagementBaseObject inParams =
classInstance.GetMethodParameters("Create"); // Add the input parameters.
inParams["Name"] = "share name";
inParams["Path"] = "D:\\新建文件夹";
inParams["Type"] = 0; // Execute the method and obtain the return values.
ManagementBaseObject outParams =
classInstance.InvokeMethod("Create", inParams, null); // List outParams
Console.WriteLine("Out parameters:");
Console.WriteLine("ReturnValue: " + outParams["ReturnValue"]);
}
catch(ManagementException err)
{
MessageBox.Show("An error occurred while trying to execute the WMI method: " + err.Message);
}
}
}
}
http://www.zwwr.com/article/show.asp?id=554
DirectoryEntry这个类的命名空间也没有!!!!!!!!