एक और तरीका यह बिल्ली त्वचा के लिए: यहाँ इस के साथ आप मदद कर सकता है कि एक टुकड़ा है स्थापित) WMI कॉल आह्वान करने के लिए, System.Management.Automation के लिए एक संदर्भ में शामिल हैं, यह सबसे likley \ प्रोग्राम फ़ाइलों में होगा \ संदर्भ विधानसभाओं \ Microsoft \
private void button1_Click(object sender, EventArgs e)
{
Runspace rs = RunspaceFactory.CreateRunspace();
rs.Open();
Pipeline pl = rs.CreatePipeline();
pl.Commands.AddScript("get-wmiobject win32_share");
StringBuilder sb = new StringBuilder();
Collection<PSObject> list = pl.Invoke();
rs.Close();
foreach (PSObject obj in list)
{
string name = obj.Properties["Name"].Value as string;
string path = obj.Properties["Path"].Value as string;
string desc = obj.Properties["Description"].Value as string;
sb.AppendLine(string.Format("{0}{1}{2}",name, path, desc));
}
// do something with the results...
}
स्रोत
2008-09-25 23:19:01
windowspowershell क्या आप मुझे बता सकते हैं कि कैसे साझा फ़ोल्डर की जाँच करने के स्थानीय पीसी में मौजूद है। मुझे इसे पॉकेट पीसी से उपयोग करने की आवश्यकता है (उपयोग करना .NET कॉम्पैक्ट फ्रेमवर्क), इस https://stackoverflow.com/questions/25710537/check-shared-path-is-available-in-pc – user2681579