当我在共享网络中创建目录时,我有异常(句柄无效)HR结果-2147024890:
var value = myPieChart.segments[i].value/totalValue*100;
if(Math.round(value) !== value)
value = (myPieChart.segments[i].value/totalValue*100).toFixed(1);
value = value + '%';
你知道为什么以及如何解决它吗?
答案 0 :(得分:0)
首先,运行应用程序的用户帐户必须能够访问UNC路径,否则这将无效。只需这样做:
const string PATH = @"<Your UNC Path>";
DirectoryInfo di = new DirectoryInfo(PATH);
DirectorySecurity ds = di.GetAccessControl();
Directory.CreateDirectory(PATH + @"\<Your new Dir>", ds);