开发者

How can I use the COM object "VirtualPC.Application" to automate Windows Virtual PC from c#

开发者 https://www.devze.com 2022-12-19 02:26 出处:网络
I\'ve read that Windows Virtual PC comes with a COM interface (VirtualPC.Application). I\'ve read blogs about how to use it from Powershell. But how can I use it from c#? Specifically, is there a Prim

I've read that Windows Virtual PC comes with a COM interface (VirtualPC.Application). I've read blogs about how to use it from Powershell. But how can I use it from c#? Specifically, is there a Primary Interop Assembly (PIA) that I can use in c# to get int开发者_开发知识库ellisense in visual studio?


  • Export the COM wrapper with:

    tlbimp c:\windows\system32\vpc.exe /out:\vpc.dll

  • Add a reference to the generated dll: vpc.dll

  • Create the object and use it from C#: var vpc_obj = new vpc.VMVirtualPCClass();
0

精彩评论

暂无评论...
验证码 换一张
取 消