简体   繁体   English

如何使用visual studio.net打开visual basic 6程序

[英]How to open visual basic 6 program with visual studio.net

I want to open a program (written in Visual basic 6) to be open in Visual Studio.net.我想打开一个要在 Visual Studio.net 中打开的程序(用 Visual Basic 6 编写)。 Please guide, how could I do that?请指导,我该怎么做?

While trying to open VB6 (.vbp file) program directly from the OPEN project option in visual studion.net, I was getting this error,尝试直接从 Visual studion.net 中的 OPEN 项目选项打开 VB6(.vbp 文件)程序时,出现此错误,

"Visual Basic 6 (.vbp) files cannot be opened in Visual Studio" “无法在 Visual Studio 中打开 Visual Basic 6 (.vbp) 文件”

I am trying to open in VS 2010.我正在尝试在 VS 2010 中打开。

Visual Studio 2010 does not support VB6 projects. Visual Studio 2010 不支持 VB6 项目。 See the linkhere请参阅此处的链接

From themsdn documentation:msdn 文档:

Visual Studio 2010 does not provide tools for upgrading applications and projects from Visual Basic 6.0. Visual Studio 2010 不提供用于从 Visual Basic 6.0 升级应用程序和项目的工具。 If you want to upgrade your project from Visual Basic 6.0 to Visual Basic 2010, you can use the upgrade tools provided with earlier versions of Visual Studio and then upgrade the project again in Visual Studio 2010.如果要将项目从 Visual Basic 6.0 升级到 Visual Basic 2010,可以使用 Visual Studio 早期版本提供的升级工具,然后在 Visual Studio 2010 中再次升级项目。

There's a plugin called Visual Basic Tools for Visual Studio that provides the following features:有一个名为Visual Basic Tools for Visual Studio的插件,它提供以下功能:

  • load classic VB workspace- and project-files and offers quick access to the extension´s options加载经典的 VB 工作区和项目文件,并提供对扩展选项的快速访问

  • integrates with the solution explorer and the code editor having support for syntax highlighting, basic outlining (allows to expand/collapse methods, properties and types) as well as navigation bar support.与解决方案资源管理器和代码编辑器集成,支持语法突出显示、基本大纲(允许展开/折叠方法、属性和类型)以及导航栏支持。

  • Classes, Types, Modules, Forms and Controls can be inspected using the Object Browser and Class View.可以使用对象浏览器和类视图检查类、类型、模块、表单和控件。

From the reading, it's unclear if you can actually build the project, though it does say:从阅读来看,目前还不清楚您是否可以真正构建该项目,尽管它确实说:

The import tool creates a new solution and MSBuild compatible projects.导入工具会创建一个新的解决方案和 MSBuild 兼容项目。

Links to the plugin by VS Version VS 版本的插件链接

Speaking from my Experience, its not easy to open a Visual Basic 6.0 project in any Versions of Visual Studio above 2008.根据我的经验,在 2008 年以上的任何版本的 Visual Studio 中打开 Visual Basic 6.0 项目都不容易。

Although 2008 and below version provide an automatic function to convert Vb6 code to VB.net framework.尽管 2008 及以下版本提供了将 Vb6 代码转换为 VB.net 框架的自动功能。 But the problem starts after the conversion, it Skips some code, add function/variables on its own, or modify the functional behavior on its own, with it the VB.proj will be created with error and you will not be able to open it anywhere as solution file.但是转换之后问题就开始了,它跳过一些代码,自己添加函数/变量,或者自己修改函数行为,这样会导致VB.proj创建错误,您将无法打开它任何地方作为解决方案文件。 3rd party tools also the same. 3rd 方工具也一样。

If you want to open the VB6 code try Visual Basic 6.0 Portable edition.如果要打开 VB6 代码,请尝试 Visual Basic 6.0 Portable edition。 But headache will still follow you there, please refer this link Installation of VB6 on Windows 7 (or Windows 8) (or Windows 10)但是头痛仍然会跟着你,请参考这个链接Installation of VB6 on Windows 7 (or Windows 8) (or Windows 10)

Make sure you are clicking on the project file itself... Right click on the file and select "Open With" and select your visual studio program.确保您单击的是项目文件本身...右键单击该文件并选择“打开方式”并选择您的 Visual Studio 程序。 It may need to be converted and if so, it will prompt you to convert the project.它可能需要转换,如果是这样,它会提示您转换项目。

Thanks!谢谢!

下载用于 Visual Studio 的 Visual Basic 工具,允许使用经典的 VB 工作区和项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM