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 函数关系 | MicrosoftWin32和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 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 属性 |
VB6.0 和VB.NET 函数对比的更多相关文章
- 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的微软官方文档
升级流程大体是这样的: 1.用VS2008打开Vb6.0的工程(此时针对语言层面自动升级). 注: VS更新多版了(当前最新VS2017),用最新版再打开2008升级后的工程的时候还是会有自动升级,相 ...
- VB6.0调用DLL
目录 第1章 VB6.0调用DLL 1 1 VC++编写DLL 1 1.1 使用__stdcall 1 1.2 使用 .DEF 文件 1 2 简单数据类型 2 2.1 传 ...
- VB6.0编程笔记——(2)开发环境准备&学习前导入
工欲善其事必先利其器,着手开始学习写代码之前,我们需要先准备好需要用到的工具.这篇文章会教大家部署好环境,同时会告知前期我们需要知道的一点内容(可以不用特别理解,只要记住用法就行,后续会深入展开介绍) ...
- VB6.0编程笔记——(1)篇外篇&目录
从计算机专业毕业到进入IT行业,说来也有些年头了.相比较而言算是幸运,也有很多的同学进入了其他行业,也有一些朋友又想进入这个行业.现在回想自己的一路历程,总结一下,也是一份记忆. 基于以上的原因,希望 ...
- 吐个槽,对VB6.0 还有VBS 说ByeBye
往事不堪回首,折腾了个把月的老系统,心中郁结,不吐不快.系统架构是ASP +VBS +VB6.0 + SQL Server2000, 第一个版本开发完成大概是在2000年.基本是处于交接无力,看代码就 ...
- 【原创】VB6.0应用程序安装包的生成(Setup Factory 9.0制作安装包的方法)
VB6.0应用程序安装包的生成,利用其自带的打包工具生成的安装程序很简陋,一点不美观:如果想让自己的应用程序安装的时候显得高大上一点,本教程提供使用Setup Factory 9.0制作安装包的方法. ...
- vb6.0安装程序制作图解教程
如何制作vb安装程序,是在学习Vb6.0过程中比较常见的一个入门问题. 在此笔者介绍一个最简单的安装方法,就是用VB自带的打包程序进行打包,虽然比较普通,不过内部却有不少窍门,相信这一点知道的人可能不 ...
- VB6.0
1. 安装包来自 http://msdn.itellyou.cn/ 下载的文件为: sc_vb6_ent_cd1.iso sc_vb6_ent_cd2.iso 2.安装时,"请输入产品的 I ...
随机推荐
- Atitit 动态调用webservice与客户端代理方式调用
Atitit 动态调用webservice与客户端代理方式调用 方式1: 使用call.invoke 直接调用WSDL,缺点:麻烦,不推荐--特别是JAVA调用.NET的WS时,会有不少的问题需要解 ...
- iOS开发--应用崩溃日志揭秘(二)
场景 4: 吃棒棒糖时闪退! 用户邮件说, “当rage master吃棒棒糖时应用就闪退…” 另一用户说, “我让rage master 吃棒棒糖,没几次应用就闪退了!”崩溃日志如下: Incide ...
- php ajax 交互
html 页面 <body> <button id="oBtn">点击我</button> <script type="text ...
- DataGrid中的事件和方法
事件: onLoadSuccess:数据加载成功的时候触发. onLoadError:在载入远程数据产生错误的时候触发. onClickCell:在用户点击一个单元格的时候触发. onDblClick ...
- jquery-懒加载插件
在Web应用程序中,系统的瓶颈常在于系统的响应速度.如果系统响应速度过慢,用户就会出现埋怨情绪, 系统的价值也因此会大打折扣.因此,提高系统响应速度,是非常重要的. 从此可知,再好的网站,再炫的网站, ...
- SVN代码冲突解决方案小集合
对于刚接触svn的人来说,svn冲突后,不能提交是件让人很郁闷的事情.最让人郁闷的事,是代码间的覆盖.你把我代码盖了,我会很火大的.谁把谁的盖了都不爽. 为什么会出现代码冲突问题呢,因为不同的人,同时 ...
- 实战MEF(1):一种不错的扩展方式
在过去,我们完成一套应用程序后,如果后面对其功能进行了扩展或修整,往往需要重新编译代码生成新的应用程序,然后再覆盖原来的程序.这样的扩展方式对于较小的或者不经常扩展和更新的应用程序来说是可以接受的,而 ...
- Gridview里添加合计行
ShowFooter="true" ; ; ; protected void gvIncomeYG_RowDataBound(object sender, GridViewRowE ...
- 前端学PHP之面向对象系列第五篇——对象操作
× 目录 [1]对象克隆 [2]对象比较[3]对象串行化[4]json 前面的话 本文主要介绍面向对象中的一些对象操作 对象克隆 对象复制,又叫对象克隆,可以通过 clone 关键字来完成 在多数情况 ...
- Html,Css,Dom,javascript细节总结
最近愈发觉得基础的重要性,细节决定成败,所以希望能够将自己注意到的搜集到的一些关于前端的小细节小知识整理出来,更好的方便自己记忆回顾. 1.在构建网页Html框架时,尽量只给外层标记(即是父标记)定义 ...