VB6与VB.NET对照表
VB6与VB.NET对照表
|
VB6.0 |
VB.NET |
|
AddItem Object名.AddItem |
Object名.Items.Add ListBox1.Items.Add ComboBox1.Items.Add |
|
Abs 函数 |
System.Math.Abs 方法 |
|
API 函数关系 |
Microsoft Win32和Microsoft .NET Framework API的对应 |
|
App.Path 等 |
1. System.Reflection.Assembly.GetExecutingAssembly.Location |
|
2. Application.StartupPath |
|
|
3. Application.ExecutablePath |
|
|
4. System.AppDomain.CurrentDomain.BaseDirectory |
|
|
App.PrevInstance |
Process.GetProcessesByName(pn).GetUpperBound(0) > 0 |
|
As Any 关键词 |
Visual Basic .NET 不提供支持。 参考方法(SendMessage) |
|
AscB 函数 |
Microsoft.VisualBasic.Strings.Asc 函数 |
|
Atn 函数 |
System.Math.Atan 方法 |
|
AutoRedraw 属性 |
没有相同项目。 |
|
Beep |
Microsoft.VisualBasic.Beep() |
|
Caption 属性 |
Text 属性 |
|
CBool 函数 |
CBool 函数 |
|
CByte 函数 |
CByte 函数 |
|
CDate 函数 |
CDate 函数 |
|
CDbl 函数 |
CDbl 函数 |
|
CDec 函数 |
CDec 函数 |
|
ChDir 语句 |
Microsoft.VisualBasic.FileSystem.ChDir 函数 |
|
System.IO.Directory.SetCurrentDirectory 方法 |
|
|
ChDrive 语句 |
Microsoft.VisualBasic.FileSystem.ChDrive 函数 |
|
Chr$ 函数、ChrB 函数 |
Microsoft.VisualBasic.Strings.Chr 函数 |
|
CInt 函数 |
CInt 函数 |
|
Circle 方法 |
System.Drawing.Graphics.DrawEllipse 方法 |
|
CLong 函数 |
CLong 函数 |
|
Close 语句 |
Microsoft.VisualBasic.FileSystem.FileClose 函数 |
|
System.IO.StreamReader.Close 方法 |
|
|
Clipboard 对象 |
System.Windows.Forms.Clipboard 命名空间 |
|
ClipControls 属性 |
没有相同项目。 |
|
Cls 方法 |
System.Drawing.Graphics.Clear 方法 |
|
Color QBColor vbBlack RGB() |
System.Drawing.Color.Black |
|
Command |
System.Environment.GetCommandLineArgs |
|
Combo1.AddItem |
ComboBox1.Items.Add |
|
Cos 函数 |
System.Math.Cos 方法 |
|
CSng 函数 |
CSng 函数 |
|
CStr 函数 |
CStr 函数 |
|
CurDir 函数 |
System.IO.Directory.GetCurrentDirectory() 方法 |
|
Currency 类型 |
Decimal 类型 |
|
CurrentX 属性 |
各种图形相关方法的 x 参数。比如、DrawRectangle(pen, x, y, width, height) |
|
CurrentY 属性 |
各种图形相关方法的 y 参数。比如、DrawRectangle(pen, x, y, width, height) |
|
Date 函数、Date 语句 |
System.DateTime.Now System.DateTime.Today.ToString |
|
Date$ 函数 |
Microsoft.VisualBasic.DateAndTime.DateString |
|
DateAdd 函数 |
System.DateTime.AddYears 方法 AddMonths AddDays |
|
DateDiff 函数 |
Microsoft.VisualBasic.DateDiff 函数 |
|
DateValue 函数 |
System.DateTime.Parse 方法 CDate 函数 |
|
DatePart 函数 |
Microsoft.VisualBasic.DatePart 函数 |
|
Day 函数 |
System.DateTime.Day 属性 |
|
Debug.Print |
Debug.WriteLine |
|
DeleteSetting 语句 |
Microsoft.VisualBasic.Interaction.DeleteSetting |
|
DoEvents 函数 |
System.Windows.Forms.Application.DoEvents 方法 |
|
DrawMode 属性 |
System.Drawing.Pen.Color 属性 |
|
DrawStyle 属性 |
System.Drawing.Pen.PenType 属性 |
|
DrawWidth 属性 |
System.Drawing.Pen.Width 属性 |
|
Environ |
Microsoft.VisualBasic.Interaction.Environ |
|
System.Environment.GetFolderPath |
|
|
Exp 函数 |
System.Math.Exp 方法 |
|
FillColor 属性 |
System.Drawing.SolidBrush.Color 属性 |
|
FileCopy 语句 |
Microsoft.VisualBasic.FileSystem.FileCopy 函数 |
|
System.IO.File.Copy 方法 |
|
|
FileLen 函数 |
System.IO.FileInfo.Length 属性 |
|
Microsoft.VisualBasic.FileSystem.FileLen |
|
|
FillStyle 属性 |
System.Drawing.Pen.Brush 属性 |
|
Get 语句 |
Microsoft.VisualBasic.FileSystem.FileGet 函数 |
|
GetAttr |
System.IO.File.GetAttributes |
|
GotFocus 事件 |
Enter 事件 |
|
GetSetting 语句 |
Microsoft.VisualBasic.Interaction.GetSetting |
|
FileDateTime 函数 |
System.IO.File.GetCreationTime 方法 |
|
HasDC 属性 |
没有相同项目。 |
|
HDC 属性 |
没有相同项目。 |
|
Height 属性 |
Control.Size 属性 |
|
Hour 函数 |
System.DateTime.Hour 属性 |
|
hwnd Form1.hwnd |
Form1.Handle 定义处也是 ByVal hWnd As IntPtr |
|
Image 属性 |
Image 属性 |
|
Input # 语句 |
Microsoft.VisualBasic.FileSystem.Input 函数 |
|
InStr 函数 |
System.String.IndexOf |
|
Microsoft.VisualBasic.Strings.InStr 函数 |
|
|
InStrB 函数 |
Microsoft.VisualBasic.Strings.InStr 函数 |
|
InStrRev 函数 |
System.String.LastIndexOf 方法 |
|
Microsoft.VisualBasic.Strings.InStrRev 函数 |
|
|
Int 函数 |
System.Math.Floor 方法 |
|
System.Math.Ceiling 方法 |
|
|
Microsoft.VisualBasic.Int 函数 |
|
|
Integer 类型 Long 类型 |
Dim y As Integer 改为 Dim x As Short |
|
Dim y As Long 改为 Dim y As Integer |
|
|
IsEmpty 函数 |
Microsoft.VisualBasic.Information.IsNothing 函数 |
|
IsDate 函数 |
Microsoft.VisualBasic.IsDate 函数 |
|
IsNull 函数 |
Microsoft.VisualBasic.Information.IsDBNull 函数 |
|
IsObject 函数 |
Microsoft.VisualBasic.Information.IsReference 函数 |
|
Join 函数 |
System.String.Join 方法 |
|
KeyAscii |
e.KeyChar 属性 |
|
Kill 语句 |
Microsoft.VisualBasic.FileSystem.Kill 函数 |
|
System.IO 命名空间 FileInfo.Delete 方法 |
|
|
LBound UBound |
System.Array.GetLowerBound System.Array.GetUpperBound |
|
LCase$ 函数 |
String.ToLower 方法 |
|
Microsoft.VisualBasic.Strings.LCase 函数 |
|
|
Left 属性 |
Control.Location 属性 |
|
Left$、LeftB、LeftB$ |
System.String.SubString |
|
Microsoft.VisualBasic.Strings.Left 函数 |
|
|
Len |
System.String.Length |
|
Microsoft.VisualBasic.Strings.Len |
|
|
LenB |
System.Text.Encoding.GetEncoding("gb2312").GetByteCount(str1) |
|
System.Text.Encoding.Unicode.GetByteCount("123大小大") '结果 12 |
|
|
System.Text.Encoding.Default.GetByteCount("123大小大") '结果 9 |
|
|
Line 方法 |
System.Drawing.Graphics.DrawLine 方法 |
|
Line Input # 语句 |
Microsoft.VisualBasic.FileSystem.LineInput 函数 |
|
List1.AddItem |
ListBox1.Items.Add |
|
LoadPicture 函数 |
System.Drawing.Image.FromFile("..\..\test.bmp") |
|
Lock 语句 |
Microsoft.VisualBasic.FileSystem.Lock 函数 |
|
Log 函数 |
system.Math.Log 方法 |
|
Long 类型 Integer 类型 |
Dim y As Integer 改为 Dim x As Short |
|
Dim y As Long 改为 Dim y As Integer |
|
|
LostFocus 事件 |
Leave 事件 |
|
LTrim$ 函数 |
System.String.TrimStart |
|
Microsoft.VisualBasic.Strings.LTrim 函数 |
|
|
Mid 函数 |
System.String.SubString |
|
Microsoft.VisualBasic.Strings.Mid 函数 |
|
|
MidB 函数 |
Microsoft.VisualBasic.Strings.Mid 函数 |
|
Minute 函数 |
System.DateTime.Minute 属性 |
|
MkDir 语句 |
Microsoft.VisualBasic.FileSystem.MkDir 函数 |
|
System.IO.Directory.CreateDirectory 方法 |
|
|
MousePointer=11 |
System.Windows.Forms.Cursors.WaitCursor() |
|
Screen.MousePointer |
System.Windows.Forms.Cursor.Current = Cursors.WaitCursor |
|
Mod 运算符 |
Math.IEEERemainder 方法 Debug.WriteLine(Math.IEEERemainder(10, 3)) '结果 1 |
|
System.Math.DivRem(10, 3, intResult) '结果3 (10 \ 3) |
|
|
Debug.WriteLine(intResult) '结果1 (10 Mod 3) |
|
|
Month 函数 |
System.DateTime.Month 属性 |
|
MsgBox |
System.Windows.Forms.MessageBox.Show("Hello, world!") |
|
Microsoft.VisualBasic.MsgBox |
|
|
Name 语句 |
Microsoft.VisualBasic.FileSystem.Rename 函数 |
|
Now 函数 |
System.DateTime.Now Microsoft.VisualBasic.Now |
|
Open 语句 |
Microsoft.VisualBasic.FileSystem.FileOpen 函数 |
|
Option Base 语句 |
Visual Basic .NET没有提供支持。 |
|
Option Private |
Visual Basic .NET没有提供支持。 |
|
PaintPicture 方法 |
System.Drawing.Graphics.DrawImage 方法 |
|
Point 方法 |
不存在相同的Form和控件。 |
|
使用Bitmap时用System.Drawing.Bitmap.GetPixel 方法 |
|
|
Print 方法 |
System.Drawing.Graphics.DrawString 方法 |
|
PrintForm |
Visual Basic .NET没有提供支持。 |
|
Print# 语句 |
Microsoft.VisualBasic.FileSystem.Print 函数 |
|
Private 语句 |
Private Public |
|
Public 语句 |
Friend Protected Protected Friend |
|
Pset 方法 |
不存在相同的Form和控件。 |
|
使用Bitmap时用System.Drawing.Bitmap.SetPixel 方法 |
|
|
Put 语句 |
Microsoft.VisualBasic.FileSystem.FilePut 函数 |
|
Replace 函数 |
Microsoft.VisualBasic.Strings.Replace 函数 |
|
Right$ 函数、RightB 函数 |
System.String.SubString |
|
Microsoft.VisualBasic.Strings.Right 函数 |
|
|
ReDim 语句 |
ReDim MyArray(5) ReDim Preserve MyArray(15) 语句 |
|
RmDir 语句 |
Microsoft.VisualBasic.FileSystem.RmDir 函数 |
|
System.IO.Directory.Delete() 方法 |
|
|
Round 函数 |
System.Math.Round 方法 |
|
RTrim$ 函数 |
System.String.TrimEnd |
|
Microsoft.VisualBasic.Strings.RTrim |
|
|
SaveSetting 语句 |
Microsoft.VisualBasic.Interaction.SaveSetting 函数 |
|
Scale 方法 |
Visual Basic .NET没有提供支持。 |
|
Screen.ActiveControl |
System.Windows.Forms.Application.ActiveForm.ActiveControl |
|
Screen.ActiveForm |
System.Windows.Forms.Application.ActiveForm |
|
Screen.Fonts |
System.Drawing.FontFamilies |
|
Screen.Height |
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height |
|
Screen.MousePointer |
System.Drawing.Cursor.Current |
|
Screen.Width |
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width |
|
Second 函数 |
System.DateTime.Second 属性 |
|
SendKeys 语句 |
System.Windows.Forms.SendKeys.Send("^C") |
|
SetAttr |
System.IO.File.SetAttributes |
|
Sgn 函数 |
System.Math.Sign 函数 |
|
Shell |
Microsoft.VisualBasic.Shell |
|
Sin 函数 |
System.Math.Sin 函数 |
|
Space 函数 |
Microsoft.VisualBasic.Strings.Space 函数 |
|
Sqr 函数 |
System.Math.Sqrt 函数 |
|
StrComp 函数 |
Microsoft.VisualBasic.Strings.StrComp 函数 |
|
StrConv 函数 |
Microsoft.VisualBasic.Strings.StrConv 函数 |
|
String$(256, Chr(0)) |
buf = New String(CChar(" "), 256) Microsoft.VisualBasic.Strings.StrDup 函数 |
|
StrReverse 函数 |
Microsoft.VisualBasic.Strings.StrReverse 函数 |
|
Tan 函数 |
System.Math.Tan 方法 |
|
TextHeight 属性 |
System.Drawing.Font.Height 属性 |
|
TextWidth 属性 |
System.Drawing.Graphics.MeasureString 方法 |
|
Time$ 函数 |
Microsoft.VisualBasic.DateAndTime.Timer 属性 |
|
System.DateTime.Now.TimeOfDay |
|
|
TimeValue 函数 |
System.DateTime.Parse 方法 CDate 函数 |
|
Top 属性 |
Control.Location 属性 |
|
Trim$ 函数 |
Microsoft.VisualBasic.Strings.Trim 函数 |
|
System.String.Trim |
|
|
Type 语句 |
Structure 语句 |
|
UCase$ 函数 |
String.ToUpper 方法 |
|
Microsoft.VisualBasic.Strings.UCase 函数 |
|
|
Unlock 语句 |
Microsoft.VisualBasic.FileSystem.Unlock 函数 |
|
Unload 事件 |
Closed 事件 Me.Close() |
|
Variant 型 |
Dim x As Variant 改为 Dim x As Object |
|
VarPtr、StrPtr、ObjPtr |
Dim MyGCHandle As GCHandle = GCHandle.Alloc(o,GCHandleType.Pinned) |
|
Dim Address As Integer = CInt(MyGCHandle.AddrOfPinnedObject()) |
|
|
MyGCHandle.Free() ' 允许对象实例再移动。 |
|
|
vbCrLf |
Microsoft.VisualBasic.Constants.vbCrLf |
|
Microsoft.VisualBasic.vbCrLf |
|
|
Weekday |
Microsoft.VisualBasic.Weekday System.DateTime.DayOfWeek |
|
WeekdayName |
Microsoft.VisualBasic.WeekdayName (System.DateTime 构造体中没有相同项目) |
|
Width 属性 |
Control.Size 属性 |
|
Write # 语句 |
Microsoft.VisualBasic.FileSystem.Write 函数 |
|
Year 函数 |
System.DateTime.Year 属性 |
VB6与VB.NET对照表的更多相关文章
- VBA/VB6/VBS/VB.NET/C#/Python/PowerShell都能调用的API封装库
API函数很强大,但是声明的时候比较繁琐. 我开发的封装库,包括窗口.键盘.鼠标.消息等常用功能.用户不需要添加API函数的声明,就可以用到API的功能. 在VBA.VB6的引用对话框中引用API.t ...
- 【VB/.NET】Converting VB6 to VB.NET 【Part II】【之四】
第四部分 原文 DLLs, DAO, RDO, ADO, and AD.NET; the History of VB DBs In the early versions of VB, there we ...
- vb6转vb.net
一直在用vb6写软件,但最近系统要做web版,但之前的业务规则全在代码中写死了,没用使用存贮过程,如果在web端重写规则,则工作量太大,项目时间也不允许,只好把业务规则转到vb.net中.现在的vb. ...
- VB6.0和VB.Net的函数等对照表
VB6.0和VB.Net的对照表 VB6.0 VB.NET AddItem Object名.AddItem Object名.Items.Add ListBox1.Items.Add ComboBox1 ...
- VB6.0 和VB.NET 函数对比
VB6.0和VB.Net的对照表 VB6.0 VB.NET AddItem Object名.AddItem Object名.Items.Add ListBox1.Items.Add ComboBox1 ...
- 自写函数VB6 STUFF函数 和 VB.net 2010 STUFF函数 详解
'*************************************************************************'**模 块 名:自写函数VB6 STUFF函数 和 ...
- vb和vb.net事件机制
学习java事件前,回顾了下vb6和vb.net的事件机制,总结在这里,供对比用. 事件是面对对象中对象间通信的方法.事件发生者(又叫事件源)发生一个事件时,通过发送一条消息,给事件接受者(事件处理者 ...
- vb.net 总结
vb.net 可以说是vb6.0的升级版,在语法结构上与vb很相似.那么,我们就来说一下它们之间有什么不同的地方吧. vb6.0 vb是我们入门的一个非常好的编程软件,它可以实现软件 ...
- 再见VB6!再见程序生涯!
今天写一篇博文告别使用了15年的VB6,从此终结程序生涯.记得读大学的时候第一学习编程,用VB6嵌入MediaPlayer控件写了一个简易视频播放器,看着视频的画面激动人心,从此就爱上了编程,从此也和 ...
随机推荐
- iOS音频解码表格
- spring中InitializingBean接口使用理解
InitializingBean接口为bean提供了初始化方法的方式,它只包括afterPropertiesSet方法,凡是继承该接口的类,在初始化bean的时候会执行该方法. 测试程序如下: imp ...
- svn检出项目
第一步: 第二步: 第三步: 第四步: 第五步: 填写项目名称 第六步: 选择路径 第七步:
- Ubuntu Server 14.04 --secure-file-priv error in MySql 解决方案
在VPS部署Ubuntu 14.04服务器时,MySQL执行导出文件命令,报错: The MySQL server is running with the --secure-file-priv opt ...
- 企业号查询部门id(改版后)
1.搜索部门,输入"名称" 2.在后面可以查到部门ID
- Apple Pay 初探
Apple Pay 一.概述 1.支付方式:Touch ID/ Passcode 2.设备要求:iPhone6以上(iphone:线上/线下 ipad:线上 watch:线下) 3.系统要求:iOS8 ...
- React学习笔记-7-销毁阶段
销毁阶段可以使用的函数:componentWillUnmount:在删除组件之前进行清理操作,比如计时器和事件监听器.因为这些函数都是开发者手动加上去的,react不知道,必须进行手动清理. 实例第一 ...
- 372. Super Pow
问题 Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large p ...
- 【转】Caffe初试(八)Blob,Layer和Net以及对应配置文件的编写
深度网络(net)是一个组合模型,它由许多相互连接的层(layers)组合而成.Caffe就是组建深度网络的这样一种工具,它按照一定的策略,一层一层的搭建出自己的模型.它将所有的信息数据定义为blob ...
- IOS进阶之WKWebView
前言 Xcode8发布以后,编译器开始不支持IOS7,所以很多应用在适配IOS10之后都不在适配IOS7了,其中包括了很多大公司,网易新闻,滴滴出行等.因此,我们公司的应用也打算淘汰IOS7. 支持到 ...