WMI查询转义单引号

时间:2018-03-19 03:19:00

标签: c# wmi wmi-query

string dirName = @"D:\Test't";
string qry = "associators of {Win32_Directory.Name='" + dirName + "'} where assocclass = Win32_SubDirectory ResultRole = PartComponent";

执行上述WMI查询时,我收到无效对象路径异常。如何在WMI查询中转义单引号?

0 个答案:

没有答案