-
VB6 to VB.net的对应速查
VB6
VB.NET
-----------------------------------------------------
DoEvents
System.Windows.Forms.Application.DoEvents()
Command1.BackColor = vbRed
Command1.BackColor = System.Drawing.Color.Red
Command1.BackColor = System.Drawing.Color.FromARGB(&H80C0FF)
ComboBox1.AddItem "one"
ComboBox1.Items.Add("one")
Command1.BackColor = &H80C0FF
Command1.BackColor = System.Drawing.ColorTranslator.FromOle(&H80C0FF&)
Form1.Caption = "Sample"
Form1.DefInstance.Text = "Sample"
Form1.Top
Form1.DefInstance.Top
MsgBox "message", vbInformation, "title"
MsgBox("message", MsgBoxStyle.Information, "title")
Form1.Height = 3500
Form1.DefInstance.Height = VB6.TwipsToPixelsY(3500)
Set MyObject = Command1
MyObject = Command1
Text1.SetFocus
Text1.Focus()
Command1.ToolTipText = "click me"
ToolTip1.SetToolTip(Command1, "click me")
Dim objAbout As AboutForm
Dim objAbout As Pharfruminsain_AboutForm_v1r0.AboutForm
sPath = App.Path
sPath = Application.StartupPath
Private Sub Form_Unload(Cancel As Integer)
Private Sub Form1_Closed(....) Handles MyBase.Closed
List1.RemoveItem (0)
ListBox1.Items.Remove(0)
Dim arOne(10) As String
Dim arOne As New ArrayList(10)
Print #1, "sample text"
PrintLine(1, "sample text")
Open "c:\myfile.txt" For Input As #1
FileOpen(1, "c:\myfile.txt", OpenMode.Input)
Line Input #1, sTemp
sTemp = LineInput(1)
VB6:
s=App.Comments
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).Comments
VB6:
s=App.CompanyName
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).CompanyName)
VB6:
s=App.EXEName
VB.Net:
Imports System.Reflection
With New System.IO.FileInfo([Assembly].GetExecutingAssembly.Location)
s=.Name.Substring(0, .Name.Length - .Extension.Length)
End With
or
s=System.AppDomain.CurrentDomain.FriendlyName
Note: this includes the extension which would need to be parsed.
VB6:
s=App.FileDescription
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileDescription)
VB6:
App.HelpFile
VB.Net:
No direct replacement
VB6:
i=App.hInstance
VB.Net:
Imports System.Runtime.InteropServices
i=Marshal.GetHINSTANCE([Assembly].GetExecutingAssembly.GetModules()(0)).ToInt32
VB6:
s=App.LegalCopyright
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).LegalCopyright)
VB6:
s=App.LegalTrademarks
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).LegalTrademarks)
VB6:
App.LogMode
App.LogPath
VB.Net:
No direct replacement; see the EventLog object
VB6:
i=App.Major
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileMajorPart)
VB6:
i=App.Minor
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileMinorPart)
VB6:
App.NonModalAllowed
VB.Net:
No replacement
VB6:
App.OleRequestPendingMsgText
App.OleRequestPendingMsgTitle
App.OleRequestPendingTimeout
App.OleServerBusyMsgText
App.OleServerBusyMsgTitle
App.OleServerBusyRaiseError
App.OleServerBusyTimeout
VB.Net:
No replacement; OLE automation not supported
VB6:
s=App.Path
VB.Net:
s=System.Windows.Forms.Application.StartupPath
or
Imports System.Reflection
With New System.IO.FileInfo([Assembly].GetExecutingAssembly.Location)
s = .FullName.Substring(0, .FullName.Length - .Name.Length - 1)
End With
Note: this will return the path with no trailing backslash even if the application is in the root directory. The VB 6.0 App.Path method return included the trailing backslash when the executable was in a root directory.
VB6:
b=App.PrevInstance
VB.Net:
Imports System.Diagnostics
b=(UBound(Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName)) > 0)
VB6:
s=App.ProductName
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).ProductName)
VB6:
App.RetainedProject
VB.Net:
No replacement; state not supported
VB6:
i=App.Revision
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileBuildPart)
and/or:
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FilePrivatePart)
VB6:
App.StartMode
VB.Net:
No direct replacement
VB6:
App.TaskVisible
VB.Net:
No direct replacement
VB6:
App.ThreadID
VB.Net:
No direct replacement; see the System.Threading.Thread object
VB6:
App.Title
VB.Net:
The Text (caption) of the top-level form. If there are no forms then the process does not appear in Task Manager.
VB6:
App.UnattendedApp
VB.Net:
No direct replacement
Methods:
VB6:
App.StartLogging
App.LogEvent
VB.Net:
No direct replacement; see the EventLog object
出处:https://www.cnblogs.com/aowind/archive/2005/03/11/116696.html
VB.NET
-----------------------------------------------------
DoEvents
System.Windows.Forms.Application.DoEvents()
Command1.BackColor = vbRed
Command1.BackColor = System.Drawing.Color.Red
Command1.BackColor = System.Drawing.Color.FromARGB(&H80C0FF)
ComboBox1.AddItem "one"
ComboBox1.Items.Add("one")
Command1.BackColor = &H80C0FF
Command1.BackColor = System.Drawing.ColorTranslator.FromOle(&H80C0FF&)
Form1.Caption = "Sample"
Form1.DefInstance.Text = "Sample"
Form1.Top
Form1.DefInstance.Top
MsgBox "message", vbInformation, "title"
MsgBox("message", MsgBoxStyle.Information, "title")
Form1.Height = 3500
Form1.DefInstance.Height = VB6.TwipsToPixelsY(3500)
Set MyObject = Command1
MyObject = Command1
Text1.SetFocus
Text1.Focus()
Command1.ToolTipText = "click me"
ToolTip1.SetToolTip(Command1, "click me")
Dim objAbout As AboutForm
Dim objAbout As Pharfruminsain_AboutForm_v1r0.AboutForm
sPath = App.Path
sPath = Application.StartupPath
Private Sub Form_Unload(Cancel As Integer)
Private Sub Form1_Closed(....) Handles MyBase.Closed
List1.RemoveItem (0)
ListBox1.Items.Remove(0)
Dim arOne(10) As String
Dim arOne As New ArrayList(10)
Print #1, "sample text"
PrintLine(1, "sample text")
Open "c:\myfile.txt" For Input As #1
FileOpen(1, "c:\myfile.txt", OpenMode.Input)
Line Input #1, sTemp
sTemp = LineInput(1)
VB6:
s=App.Comments
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).Comments
VB6:
s=App.CompanyName
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).CompanyName)
VB6:
s=App.EXEName
VB.Net:
Imports System.Reflection
With New System.IO.FileInfo([Assembly].GetExecutingAssembly.Location)
s=.Name.Substring(0, .Name.Length - .Extension.Length)
End With
or
s=System.AppDomain.CurrentDomain.FriendlyName
Note: this includes the extension which would need to be parsed.
VB6:
s=App.FileDescription
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileDescription)
VB6:
App.HelpFile
VB.Net:
No direct replacement
VB6:
i=App.hInstance
VB.Net:
Imports System.Runtime.InteropServices
i=Marshal.GetHINSTANCE([Assembly].GetExecutingAssembly.GetModules()(0)).ToInt32
VB6:
s=App.LegalCopyright
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).LegalCopyright)
VB6:
s=App.LegalTrademarks
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).LegalTrademarks)
VB6:
App.LogMode
App.LogPath
VB.Net:
No direct replacement; see the EventLog object
VB6:
i=App.Major
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileMajorPart)
VB6:
i=App.Minor
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileMinorPart)
VB6:
App.NonModalAllowed
VB.Net:
No replacement
VB6:
App.OleRequestPendingMsgText
App.OleRequestPendingMsgTitle
App.OleRequestPendingTimeout
App.OleServerBusyMsgText
App.OleServerBusyMsgTitle
App.OleServerBusyRaiseError
App.OleServerBusyTimeout
VB.Net:
No replacement; OLE automation not supported
VB6:
s=App.Path
VB.Net:
s=System.Windows.Forms.Application.StartupPath
or
Imports System.Reflection
With New System.IO.FileInfo([Assembly].GetExecutingAssembly.Location)
s = .FullName.Substring(0, .FullName.Length - .Name.Length - 1)
End With
Note: this will return the path with no trailing backslash even if the application is in the root directory. The VB 6.0 App.Path method return included the trailing backslash when the executable was in a root directory.
VB6:
b=App.PrevInstance
VB.Net:
Imports System.Diagnostics
b=(UBound(Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName)) > 0)
VB6:
s=App.ProductName
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
s=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).ProductName)
VB6:
App.RetainedProject
VB.Net:
No replacement; state not supported
VB6:
i=App.Revision
VB.Net:
Imports System.Diagnostics
Imports System.Reflection
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FileBuildPart)
and/or:
i=FileVersionInfo.GetVersionInfo([Assembly].GetExecutingAssembly.Location).FilePrivatePart)
VB6:
App.StartMode
VB.Net:
No direct replacement
VB6:
App.TaskVisible
VB.Net:
No direct replacement
VB6:
App.ThreadID
VB.Net:
No direct replacement; see the System.Threading.Thread object
VB6:
App.Title
VB.Net:
The Text (caption) of the top-level form. If there are no forms then the process does not appear in Task Manager.
VB6:
App.UnattendedApp
VB.Net:
No direct replacement
Methods:
VB6:
App.StartLogging
App.LogEvent
VB.Net:
No direct replacement; see the EventLog object
出处:https://www.cnblogs.com/aowind/archive/2005/03/11/116696.html
栏目列表
最新更新
求1000阶乘的结果末尾有多少个0
详解MyBatis延迟加载是如何实现的
IDEA 控制台中文乱码4种解决方案
SpringBoot中版本兼容性处理的实现示例
Spring的IOC解决程序耦合的实现
详解Spring多数据源如何切换
Java报错:UnsupportedOperationException in Col
使用Spring Batch实现批处理任务的详细教程
java中怎么将多个音频文件拼接合成一个
SpringBoot整合ES多个精确值查询 terms功能实
数据库审计与智能监控:从日志分析到异
SQL Server 中的数据类型隐式转换问题
SQL Server中T-SQL 数据类型转换详解
sqlserver 数据类型转换小实验
SQL Server数据类型转换方法
SQL Server 2017无法连接到服务器的问题解决
SQLServer地址搜索性能优化
Sql Server查询性能优化之不可小觑的书签查
SQL Server数据库的高性能优化经验总结
SQL SERVER性能优化综述(很好的总结,不要错
uniapp/H5 获取手机桌面壁纸 (静态壁纸)
[前端] DNS解析与优化
为什么在js中需要添加addEventListener()?
JS模块化系统
js通过Object.defineProperty() 定义和控制对象
这是目前我见过最好的跨域解决方案!
减少回流与重绘
减少回流与重绘
如何使用KrpanoToolJS在浏览器切图
performance.now() 与 Date.now() 对比