发布网友 发布时间:2022-04-22 16:22
共5个回答
热心网友 时间:2023-10-06 13:08
如果你是win7系统的话,在VCdControlTool.exe单击右键,选择属性,在兼容性一栏中选择“以管理员身份运行此程序”确定即可。
热心网友 时间:2023-10-06 13:09
我也是在运行微软虚拟光驱点击"驱动器控制"的时候提示Cannot Open Scm拒绝访问,点击确定后再点击"安装驱动器”,又提示句柄无效,不知道怎么使用了。
热心网友 时间:2023-10-06 13:09
我也是遇到同样的问题,急需解决
热心网友 时间:2023-10-06 13:10
Hi,
Is it acceptable for you to use impersonation in your code? I did a test and found that we can get services list of a remote machine by impersonation.
CodeFx provides a demo about how to impersonate a user, you will find the demo in CSImpersonateUser solution, and in its Main method, use following code snippet:
class Program
{
static void Main(string[] args)
{
/////////////////////////////////////////////////////////////////////
// Gather the credential information of the impersonated user.
//
Console.WriteLine("Before impersonation ...");
Console.WriteLine("Current user is {0}",
WindowsIdentity.GetCurrent().Name);
Console.WriteLine("Input user name");
string username = Console.ReadLine();
Console.WriteLine("Input domain name");
string domain = Console.ReadLine();
Console.WriteLine("Input password");
SecureString password = ImpersonateUser.GetPassword();
/////////////////////////////////////////////////////////////////////
// Impersonate the specified user. The impersonation is automatically
// undone after the Impersonate method.
//
ImpersonateUser.Impersonate<object, object>(username, domain, password, null,
delegate
{
Console.WriteLine("\nDuring impersonation ...");
Console.WriteLine("Current user is {0}",
WindowsIdentity.GetCurrent().Name);
// Do the work as the user ...
ServiceController[] scList = ServiceController.GetServices("remote machine name");
foreach (ServiceController sc in scList)
{
Console.WriteLine("{2}: [{1}] {0}", sc.DisplayName, sc.Status.ToString(), sc.MachineName);
}
return null;
});
Console.WriteLine("\nAfter impersonation is undone ...");
Console.WriteLine("Current user is {0}", WindowsIdentity.GetCurrent().Name);
Console.ReadLine();
}
}
热心网友 时间:2023-10-06 13:11
不是很理解!能否详细点?