VB6.0和VB.Net对照表
想在网上找一下VB.Net中,哪些是VB6.0遗留下来的东西,哪些是VB.Net增加的东西。结果中文的没有找到,找到了一个日文网页。简单的翻译了一下,放在这里,供需要的人参考。
VB6.0和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 |
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 Screen.MousePointer |
System.Windows.Forms.Cursors.WaitCursor() 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 语句 Public 语句 |
Private 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 Screen.ActiveForm Screen.Fonts Screen.Height Screen.MousePointer Screen.Width 其他 Screen 对象 |
System.Windows.Forms.Application.ActiveForm.ActiveControl System.Windows.Forms.Application.ActiveForm System.Drawing.FontFamilies System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height System.Drawing.Cursor.Current 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 属性 |
转载于:https://www.cnblogs.com/Ronin/archive/2006/06/27/437044.html
VB6.0和VB.Net对照表相关推荐
- Windows下VB6.0开发——VB程序断点调试与顺序执行不一致问题(通信原因)
前言:这几天手上写的一段VB程序出现了断点调试与顺序执行结果不一致的情况,找问题找了很久,最后发现其实也是个能够注意的小问题,特此记录. 1. 程序架构 本次的实验结构如下,PC端的VB通过串口和 ...
- VB讲课笔记01:VB6.0安装与启动
VB讲课笔记01:VB6.0安装与启动 一.安装VB6.0 VB6.0安装在Windows7.8.10上必须设置安装程序的兼容性. 1.设置安装程序的兼容性
- vb html table,VB6.0 如何是用 datatable
搜索热词 这里介绍新的datagrid.datasoure所对应的是VB6.0 datatable或dataset,而并不是原来的Recordset.所以,在使用中,要把Recordset转换成VB6 ...
- vb3.0 升级vb6.0_将VB6升级到VB.NET(性能改进)
vb3.0 升级vb6.0 I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB ...
- 大一计算机VB自学教程,2017秋VB6.0程序设计(兰州理工大学)
spContent=50年前,Basic的诞生结束了计算机只能由专业人员使用的历史,推动了计算机的普及.Windows操作系统的出现又将Basic推向一个新的高度--Visual Basic.它是一个 ...
- 用VB操作Excel(VB6.0)(整理)
用VB操作Excel(VB6.0)(整理). 一. VB读写EXCEL表: VB本身提自动化功能可以读写EXCEL表,其方法如下: 1.在工程中引用Microsoft Excel类型库: 从" ...
- vb升级java 解决方案_如何让VB6.0升级到VB.NET的过程变得更简单?
我以前都是用C#来写,这次搞这个VB.NET项目,有点突然.还好语言都是相通的. 1.虽说以前的Microsoft Visual Basic和.NET都是微软自己的东西,可有很多功能的实现方式还不一样 ...
- vb计算机 小数前没有0,vb6.0除法运算结果不显示小数点前的0
2016-09-01 01:18齐晓庆 客户经理 在加减乘除运算中,运算结果的类型和运算量的类型相同,由于类型不同,所以出错,要达到你目的可以1000\15 1000\25,由于1.5 2.5是小数所 ...
- vb计算机怎么制作,vb6.0怎么制作一个抽奖小程序? vb6.0抽奖器的法
商场搞活动想要制作一个抽奖程序,今天我们就来看看使用vb6.0制作抽奖小程序的教程. 选择"用户自定义规则"并点击"新建"按钮,弹出选择新规则类型对话 框(如图 ...
最新文章
- 一文详解JavaBean 看这篇就够了
- mysql编辑工具wf_轻松构建自定义WF设计器
- 省市区联动三级下拉列表实现
- C++离航篇——引用,const
- 如何在BIOS里面配置sata硬盘选项
- Mac安装Homebrew教程
- 数学标记语言MathML简介、工具及兼容
- 内温的整体优先效应实验_认知
- 连接到另外计算机要用户名,连接局域网电脑需要用户名密码
- 服务器安全狗Windows V5.0正式版
- Altium Designer学习记录之一
- 图像识别平台建设之路(自建+三方产品)
- css关键词:inherit、initial、overlay、revert、unset解释
- 脏话越多,代码越好!
- 白雪公主和她的七个供应商
- 互联网指标体系构建及分析方法
- 如何本地安装chisel bootcamp
- CG-34 浊度传感器 简单说明
- 【Active Learning - 03】Adaptive Active Learning for Image Classification
- Rman 中的 2 个小小的需要注意的地方
热门文章
- docker启动mysql容器_Docker容器开机自启动
- python运算符中用来计算整商的是什么_零基础学python,看完这篇文章,你的python基础就差不多了...
- C# linq Expression left join如何使用
- java递归统计一个文件夹含子文件夹里文件不同后缀的出现次数
- linux下缓存命中测试,Linux 性能优化实战(倪朋飞)---查看缓存命中情况
- mysql 5.764_RHEL5.764位源码编译安装MySQL-5.5.42遇到的问题
- 超硬核!躺进BAT以后我总结了出现最多的15道数组题
- leetcode155. 最小栈
- C++:32---IO库
- C++(23)--多态性与虚函数