C#中的VB代码 [英] VB Code in C#

查看:143
本文介绍了C#中的VB代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我在VB中有一些代码,在C#中是新手.
所以我该如何在C#中解决这个问题?

我在VB中的代码:

Hello everybody

I Have here some Code in VB, i am new in C#
so how can i solve that in C#

My code in VB:

Sub Main()

    Dim App As Object
    App = CreateObject("PCDLRN.Application")

    Dim Part As Object
    Part = App.ActivePartProgram

    Dim Cmds As Object
    Cmds = Part.Commands

    Dim PartProg As Object
    PartProg = App.ActivePartProgram

    Part.EXECUTE()

    PartProg.Close()


感谢您的帮助!

[添加了VB标签,添加了代码格式]


Thank for your help!

[Added VB tag, added code formatting]

推荐答案

尝试一下.我希望这能奏效.

对象应用程序= CreateObject("PCDLRN.Application");
对象零件= App.ActivePartProgram;
对象Cmds = Part.Commands;
对象PartProg = App.ActivePartProgram;
Part.EXECUTE();
PartProg.Close();
Try this. I hope this works.

Object App = CreateObject("PCDLRN.Application");
Object Part = App.ActivePartProgram;
Object Cmds = Part.Commands;
Object PartProg = App.ActivePartProgram;
Part.EXECUTE();
PartProg.Close();


Google for将vb.net转换为c#",您将找到可以帮助您的转换工具.
Google for "convert vb.net to c#" and you will find conversion tools that will help you.


那里有很多免费的转换器,很少有:
将C#转换为VB.NET [将C#转换为VB.NET2 [ .NET的代码转换 [将VB转换为C#或将C#转换为VB [
There are lots of free converters, few are:
Convert C# to VB.NET [^]
Convert C# to VB.NET2[^]
Code Translation for .NET [^]
Convert VB to C# or C# to VB[^]
Try it yourself!


这篇关于C#中的VB代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆