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 函数 |
|
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 函数 |
|
Clipboard 对象 |
System.Windows.Forms.Clipboard 命名空间 |
|
ClipControls 属性 |
没有相同项目。 |
|
Cls 方法 |
System.Drawing.Graphics.Clear 方法 |
|
Color QBColor |
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 |
|
Exp 函数 |
System.Math.Exp 方法 |
|
FillColor 属性 |
System.Drawing.SolidBrush.Color 属性 |
|
FileCopy 语句 |
Microsoft.VisualBasic.FileSystem.FileCopy 函数 |
|
FileLen 函数 |
System.IO.FileInfo.Length 属性 |
|
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 |
|
InStrB 函数 |
Microsoft.VisualBasic.Strings.InStr 函数 |
|
InStrRev 函数 |
System.String.LastIndexOf 方法 |
|
Int 函数 |
System.Math.Floor 方法 System.Math.Ceiling 方法 |
|
Integer 类型 Long 类型 |
Dim y As Integer 改为 Dim x As Short |
|
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 函数 |
|
LBound UBound |
System.Array.GetLowerBound System.Array.GetUpperBound |
|
LCase$ 函数 |
String.ToLower 方法 |
|
Left 属性 |
Control.Location 属性 |
|
Left$、LeftB、LeftB$ |
System.String.SubString |
|
Len |
System.String.Length |
|
LenB |
System.Text.Encoding.GetEncoding("gb2312").GetByteCount(str1) |
|
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 |
|
LostFocus 事件 |
Leave 事件 |
|
LTrim$ 函数 |
System.String.TrimStart |
|
Mid 函数 |
System.String.SubString |
|
MidB 函数 |
Microsoft.VisualBasic.Strings.Mid 函数 |
|
Minute 函数 |
System.DateTime.Minute 属性 |
|
MkDir 语句 |
Microsoft.VisualBasic.FileSystem.MkDir 函数 |
|
MousePointer=11 |
System.Windows.Forms.Cursors.WaitCursor() |
|
Mod 运算符 |
Math.IEEERemainder 方法 Debug.WriteLine(Math.IEEERemainder(10, 3)) '结果 1 |
|
Month 函数 |
System.DateTime.Month 属性 |
|
MsgBox |
System.Windows.Forms.MessageBox.Show("Hello, world!") |
|
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和控件。 |
|
Print 方法 |
System.Drawing.Graphics.DrawString 方法 |
|
PrintForm |
Visual Basic .NET没有提供支持。 |
|
Print# 语句 |
Microsoft.VisualBasic.FileSystem.Print 函数 |
|
Private 语句 |
Private Public |
|
Pset 方法 |
不存在相同的Form和控件。 |
|
Put 语句 |
Microsoft.VisualBasic.FileSystem.FilePut 函数 |
|
Replace 函数 |
Microsoft.VisualBasic.Strings.Replace 函数 |
|
Right$ 函数、RightB 函数 |
System.String.SubString |
|
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 |
|
SaveSetting 语句 |
Microsoft.VisualBasic.Interaction.SaveSetting 函数 |
|
Scale 方法 |
Visual Basic .NET没有提供支持。 |
|
Screen.ActiveControl |
System.Windows.Forms.Application.ActiveForm.ActiveControl |
|
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 属性 |
|
TimeValue 函数 |
System.DateTime.Parse 方法 CDate 函数 |
|
Top 属性 |
Control.Location 属性 |
|
Trim$ 函数 |
Microsoft.VisualBasic.Strings.Trim 函数 |
|
Type 语句 |
Structure 语句 |
|
UCase$ 函数 |
String.ToUpper 方法 |
|
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) |
|
vbCrLf |
Microsoft.VisualBasic.Constants.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 属性 |
浙公网安备 33010602011771号