C# equivalent of VB6's GetObject

前端 未结 3 938
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 08:57

The following VB6 code connects to some third party software and forces a login with the admin username and password:

Set obj = GetObject(, \"workspace.appli         


        
3条回答
  •  时光说笑
    2021-01-04 09:18

    Even if you're working with c#, you can use all classes and methods provided by Vb.Net, including GetObject.

    Just add a reference to the .NET Component "Microsoft.VisualBasic".

    Once you have added the reference, you are able to call Microsoft.VisualBasic.Interaction.CreateObject() or Microsoft.VisualBasic.Interaction.GetObject()

提交回复
热议问题