PV 函数和将 VB6 移植到 C# [英] PV Function and Porting VB6 to C#

查看:18
本文介绍了PV 函数和将 VB6 移植到 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一些经典的 VB6 代码移植到 C# 中,并且偶然发现了 PV 函数的用法.

I'm working on porting some classic VB6 code to C# and just stumbled across a usage of the PV function.

我感觉不对,包括对 Microsoft.VisualBasic 程序集的引用.这是通常做的事情,还是我应该探索更多的选择.我想到的下一个想法是在 Reflector 中探索这个 PV 函数.

I feels wrong including a reference to the Microsoft.VisualBasic Assembly. Is this something that is commonly done, or should I explore further options. The next idea that pops into my mind is exploring this PV function in Reflector.

推荐答案

C#和VB.NET中Microsoft.VisualBasic的使用已经在这个问题.Microsoft.VisualBasic 命名空间完全支持,只要 .Net 存在,它就会存在.没有理由避免它.

The use of Microsoft.VisualBasic from C# and VB.NET has been discussed thoroughly under this question. The Microsoft.VisualBasic namespace is fully supported, and will be around as long as .Net is around. There's no reason to avoid it.

说明在打字时,这个问题的其他答案是 incorrect 重新实现该功能,并且不支持单人乐队代码库中的库.伙计们,微软需要真正的重大事件才能从 VB 中删除财务功能.

It's telling that at the time of typing, the other answers for this question are an incorrect reimplementation of the function, and a one-man-band unsupported library from Code Galleries. Come on guys, it would take a real major event for Microsoft to drop the financial functions from VB.

Microsoft.VisualBasic.Compatibility 是另一回事,它专门供 VB6 升级向导使用,EDIT 现在已在 .Net 4(我的预言成真了),不应该用于新的开发.删除对此的引用会有一些优势,但我个人可能会尝试首先引用.Net 3.5 实现一个完全正常工作的端口.

It's a different story for Microsoft.VisualBasic.Compatibility, which is exclusively for use by the VB6 upgrade wizard, EDIT has now been marked obsolete in .Net 4 (my prediction came true), and should not be used for new development. There would be some advantages in removing references to this, but personally I'd probably try to achieve a fully working port first referencing.Net 3.5.

这篇关于PV 函数和将 VB6 移植到 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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