Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VB.net警告与VB6代码:如何修复?_Vb.net_Vb6_Warnings_Compatibility_Obsolete - Fatal编程技术网

VB.net警告与VB6代码:如何修复?

VB.net警告与VB6代码:如何修复?,vb.net,vb6,warnings,compatibility,obsolete,Vb.net,Vb6,Warnings,Compatibility,Obsolete,如何使用此代码: VB6.LoadResString(i) 在未收到此警告的情况下: Public Function LoadResString(ID As Integer) As String is obsolete: 'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. http://go.microsoft.com/fwlink/?

如何使用此代码:

VB6.LoadResString(i)
在未收到此警告的情况下:

Public Function LoadResString(ID As Integer) As String is obsolete: 
'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported 
within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862'.   
错误中发布的链接和MSDN站点中的其他信息只对我说“ehy,这在您的框架中已过时,不要使用它”,但如果我需要它(从资源(.res)文件加载字符串),该怎么办

我怎么能在没有收到警告信息的情况下写呢


更新:谢谢,但没有任何效果…

它实际上并没有从.res文件加载字符串,所以很可能您需要它的假设是准确的。改为使用Project+属性和资源。在VB6
LoadResString
中,从项目资源中加载字符串。在VB.Net中实现这一点的最佳方法是使用Hans所说的.Net资源。如果要复制/迁移VB6代码,还需要从VB6资源获取字符串,例如使用VB6 IDE