private void button7_Click(object sender, EventArgs e)
{
string TargetMachine = textBox2.Text;
ManagementPath path = new ManagementPath("\\\\" + TargetMachine + "\\root\\microsoftdfs");
ManagementScope scope = new ManagementScope(path);
SelectQuery msQuery = new SelectQuery("SELECT * FROM DfsrReplicatedFolderInfo");
ManagementObjectSearcher searchProcedure = new ManagementObjectSearcher(scope, msQuery);
object[] methodArgs = { "" };
foreach (ManagementObject item in searchProcedure.Get())
{
try
{
item.InvokeMethod("GetVersionVector", methodArgs);
foreach (string returned in methodArgs)
{
MessageBox.Show(returned.ToString());
}
}
catch (SystemException excep)
{
MessageBox.Show(excep.Message);
}
}
}
0 Comments:
Post a Comment
<< Home