با سلام
با چه كدي مي تونم پوشه هاي share شده در شبكه محلي رو ببينم؟
اگه اسم كامپيوتر هارو داشته باشم چه طور؟
Printable View
با سلام
با چه كدي مي تونم پوشه هاي share شده در شبكه محلي رو ببينم؟
اگه اسم كامپيوتر هارو داشته باشم چه طور؟
سلام.
با استفاده از WMI میتونید همه اینکارها رو انجام بدین. بعنوان مثال، برای گرفتن کلیه Shared Folder های دستگاه خودتون، میتونید از کد زیر استفاده کنید:
فراموش نکنید که Reference به فایل System.Management.dll رو به برنامه اتون اضافه کنید.
using (System.Management.ManagementClass mgmt = new System.Management.ManagementClass("Win32_Share"))
{
System.Management.ManagementObjectCollection shares = mgmt.GetInstances();
foreach (System.Management.ManagementObject share in shares)
Trace.WriteLine(String.Format(@"UNC path \\{0}", share["Name"]));
}