| Comparison between VB6.0 and VB. Net |
| VB6.0 |
VB. NET |
| AddItem Object name. AddItem |
Object Name. Items. Add ListBox1.Items. Add ComboBox1.Items. Add |
| Abs Functions |
System. Math. Abs Method |
| API function relationships |
Microsoft Win32 and Microsoft. NET Framework APIs |
| App. Path, etc. |
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 keyword |
Visual Basic. NET is not supported. Reference Method (SendMessage) |
| AscB Functions |
Microsoft. VisualBasic. Strings. Asc Function |
| Atn Function |
System. Math. Atan Method |
| AutoRedraw attributes |
No same project. |
| Beep |
Microsoft. VisualBasic. Beep () |
| Caption attributes |
Text attributes |
| CBool Functions |
CBool Functions |
| CByte Functions |
CByte Functions |
| CDate Function |
CDate Function |
| CDbl Functions |
CDbl Functions |
| CDec Function |
CDec Function |
| ChDir statement |
Microsoft. VisualBasic. FileSystem. ChDir function System. IO. Directory. SetCurrentDirectory Method |
| ChDrive statement |
Microsoft. VisualBasic. FileSystem. ChDrive Function |
| Chr $ function, ChrB Function |
Microsoft. VisualBasic. Strings. Chr Function |
| CInt Function |
CInt Function |
| Circle Method |
System. Drawing. Graphics. DrawEllipse Method |
| CLong Function |
CLong Function |
| Close statement |
Microsoft. VisualBasic. FileSystem. FileClose function System. IO. StreamReader. Close Method |
| Clipboard object |
System. Windows. Forms. Clipboard namespace |
| ClipControls attributes |
No same project. |
| Cls Method |
System. Drawing. Graphics. Clear Method |
| Color QBColor vbBlack RGB () |
System. Drawing. Color. Black |
| Command |
System. Environment. GetCommandLineArgs |
| Combo1.AddItem |
ComboBox1.Items. Add |
| Cos Functions |
System. Math. Cos Method |
| CSng Function |
CSng Function |
| CStr Function |
CStr Function |
| CurDir Function |
System. IO. Directory. GetCurrentDirectory () method |
| Currency type |
Decimal type |
| CurrentX Property |
X parameters of various graph-related methods. For example, DrawRectangle (pen, x, y, width, height) |
| CurrentY Property |
Y parameters of various graph-related methods. For example, DrawRectangle (pen, x, y, width, height) |
| Date functions and Date statements |
System. DateTime. Now System. DateTime. Today. ToString |
| Date $ Function |
Microsoft. VisualBasic. DateAndTime. DateString |
| DateAdd Function |
System. DateTime. AddYears method AddMonths AddDays |
| DateDiff Function |
Microsoft. VisualBasic. DateDiff Function |
| DateValue Function |
System. DateTime. Parse method CDate Function |
| DatePart Functions |
Microsoft. VisualBasic. DatePart Function |
| Day function |
System. DateTime. Day attribute |
| Debug. Print |
Debug. WriteLine |
| DeleteSetting statement |
Microsoft. VisualBasic. Interaction. DeleteSetting |
| DoEvents Function |
System. Windows. Forms. Application. DoEvents Method |
| DrawMode attribute |
System. Drawing. Pen. Color Attribute |
| DrawStyle attributes |
System. Drawing. Pen. PenType attributes |
| DrawWidth attributes |
System. Drawing. Pen. Width attribute |
| Environ |
Microsoft. VisualBasic. Interaction. Environ System. Environment. GetFolderPath |
| Exp Function |
System. Math. Exp Method |
| FillColor attributes |
System. Drawing. SolidBrush. Color Attribute |
| FileCopy statement |
Microsoft. VisualBasic. FileSystem. FileCopy function System. IO. File. Copy method |
| FileLen Function |
System. IO. FileInfo. Length attribute Microsoft. VisualBasic. FileSystem. FileLen |
| FillStyle attributes |
System. Drawing. Pen. Brush attributes |
| Get statement |
Microsoft. VisualBasic. FileSystem. FileGet Function |
| GetAttr |
System. IO. File. GetAttributes |
| GotFocus event |
Enter event |
| GetSetting statement |
Microsoft. VisualBasic. Interaction. GetSetting |
| FileDateTime Function |
System. IO. File. GetCreationTime Method |
| HasDC attributes |
No same project. |
| HDC attributes |
No same project. |
| Height attribute |
Control. Size attribute |
| Hour Function |
System. DateTime. Hour attribute |
| Hwnd Form1.hwnd |
The Form1.Handle definition is also ByVal hWnd As IntPtr. |
| Image attributes |
Image attributes |
| Input # statement |
Microsoft. VisualBasic. FileSystem. Input Function |
| InStr Functions |
System. String. IndexOf Microsoft. VisualBasic. Strings. InStr Function |
| InStrB Function |
Microsoft. VisualBasic. Strings. InStr Function |
| Limit rev Function |
System. String. LastIndexOf method Microsoft. VisualBasic. Strings. Limit rev Function |
| Int Function |
System. Math. Floor method System. Math. Ceiling method Microsoft. VisualBasic. Int Function |
| Integer type Long |
Change Dim y As Integer to Dim x As Short Dim y As Long to Dim y As Integer. |
| IsEmpty Function |
Microsoft. VisualBasic. Information. IsNothing Function |
| IsDate Function |
Microsoft. VisualBasic. IsDate Function |
| IsNull Function |
Microsoft. VisualBasic. Information. IsDBNull Function |
| IsObject Functions |
Microsoft. VisualBasic. Information. IsReference Function |
| Join Function |
System. String. Join Method |
| KeyAscii |
E. KeyChar attributes |
| Kill statement |
Microsoft. VisualBasic. FileSystem. Kill function System. IO namespace FileInfo. Delete Method |
| LBound UBound |
System. Array. GetLowerBound System. Array. GetUpperBound |
| LCase $ Function |
String. ToLower method Microsoft. VisualBasic. Strings. LCase Function |
| Left attribute |
Control. Location Property |
| Left $, LeftB, LeftB $ |
System. String. SubString Microsoft. VisualBasic. Strings. Left Function |
| Len |
System. String. Length Microsoft. VisualBasic. Strings. Len |
| LenB |
System. text. encoding. getEncoding ("gb2312 "). getByteCount (str1) System. text. encoding. unicode. getByteCount ("123 size") 'result 12 System. text. encoding. default. getByteCount ("123 large") 'result 9 |
| Line Method |
System. Drawing. Graphics. DrawLine Method |
| Line Input # statement |
Microsoft. VisualBasic. FileSystem. LineInput Function |
| List1.AddItem |
ListBox1.Items. Add |
| LoadPicture Function |
System. Drawing. Image. FromFile ("...test.bmp ") |
| Lock statement |
Microsoft. VisualBasic. FileSystem. Lock function |
| Log Functions |
System. Math. Log Method |
| Long Integer type |
Change Dim y As Integer to Dim x As Short Dim y As Long to Dim y As Integer. |
| LostFocus event |
Leave event |
| LTrim $ Function |
System. String. TrimStart Microsoft. VisualBasic. Strings. LTrim Function |
| Mid Function |
System. String. SubString Microsoft. VisualBasic. Strings. Mid Function |
| MidB Functions |
Microsoft. VisualBasic. Strings. Mid Function |
| Minute Function |
System. DateTime. Minute attribute |
| MkDir statement |
Microsoft. VisualBasic. FileSystem. MkDir function System. IO. Directory. CreateDirectory Method |
| MousePointer = 11 Screen. MousePointer |
System. Windows. Forms. Cursors. WaitCursor () System. Windows. Forms. Cursor. Current = Cursors. WaitCursor |
| Mod Operator |
Math. IEEERemainder method Debug. writeLine (Math. IEEERemainder (10, 3) 'result 1 System. math. divRem (10, 3, intResult) 'result 3 (10 3) Debug. writeLine (intResult) 'result 1 (10 Mod 3) |
| Month Function |
System. DateTime. Month attribute |
| MsgBox |
System. Windows. Forms. MessageBox. Show ("Hello, world! ") Microsoft. VisualBasic. MsgBox |
| Name statement |
Microsoft. VisualBasic. FileSystem. Rename Function |
| Now Function |
System. DateTime. Now Microsoft. VisualBasic. Now |
| Open statement |
Microsoft. VisualBasic. FileSystem. FileOpen Function |
| Option Base statement |
Visual Basic. NET is not supported. |
| Option Private |
Visual Basic. NET is not supported. |
| PaintPicture Method |
System. Drawing. Graphics. DrawImage Method |
| Point Method |
The same Form and control does not exist. Use the System. Drawing. Bitmap. GetPixel method when using Bitmap. |
| Print Method |
System. Drawing. Graphics. DrawString Method |
| PrintForm |
Visual Basic. NET is not supported. |
| Print # statement |
Microsoft. VisualBasic. FileSystem. Print function |
| Private statement Public statement |
Private Public Friend Protected Friend |
| Pset Method |
The same Form and control does not exist. Use the System. Drawing. Bitmap. SetPixel method when using Bitmap. |
| Put statement |
Microsoft. VisualBasic. FileSystem. FilePut Function |
| Replace Function |
Microsoft. VisualBasic. Strings. Replace Function |
| Right $ function, RightB Function |
System. String. SubString Microsoft. VisualBasic. Strings. Right function |
| ReDim statement |
ReDim MyArray (5) ReDim Preserve MyArray (15) Statement |
| RmDir statement |
Microsoft. VisualBasic. FileSystem. RmDir function System. IO. Directory. Delete () method |
| Round Function |
System. Math. Round Method |
| RTrim $ Function |
System. String. TrimEnd Microsoft. VisualBasic. Strings. RTrim |
| SaveSetting statement |
Microsoft. VisualBasic. Interaction. SaveSetting Function |
| Scale Method |
Visual Basic. NET is not supported. |
| Screen. ActiveControl Screen. ActiveForm Screen. Fonts Screen. Height Screen. MousePointer Screen. Width other Screen objects |
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. other Width |
| Second Function |
System. DateTime. Second attribute |
| SendKeys statement |
System. Windows. Forms. SendKeys. Send ("^ C ") |
| SetAttr |
System. IO. File. SetAttributes |
| Sgn Function |
System. Math. Sign Function |
| Shell |
Microsoft. VisualBasic. Shell |
| Sin Function |
System. Math. Sin Function |
| Space Function |
Microsoft. VisualBasic. Strings. Space Function |
| Sqr Functions |
System. Math. Sqrt Function |
| StrComp Function |
Microsoft. VisualBasic. Strings. StrComp Function |
| StrConv Function |
Microsoft. VisualBasic. Strings. StrConv Function |
| String $ (256, Chr (0 )) |
Buf = New String (CChar (""), 256) Microsoft. VisualBasic. Strings. StrDup Function |
| StrReverse Function |
Microsoft. VisualBasic. Strings. StrReverse Function |
| Tan Function |
System. Math. Tan Method |
| TextHeight attributes |
System. Drawing. Font. Height attribute |
| TextWidth attributes |
System. Drawing. Graphics. MeasureString Method |
| Time $ Function |
Microsoft. VisualBasic. DateAndTime. Timer attribute System. DateTime. Now. TimeOfDay |
| TimeValue Function |
System. DateTime. Parse method CDate Function |
| Top attributes |
Control. Location Property |
| Trim $ Function |
Microsoft. VisualBasic. Strings. Trim function System. String. Trim |
| Type statement |
Structure statement |
| UCase $ Function |
String. ToUpper method: Microsoft. VisualBasic. Strings. UCase Function |
| Unlock statement |
Microsoft. VisualBasic. FileSystem. Unlock Function |
| Unload event |
Closed event Me. Close () |
| Variant Type |
Change Dim x As Variant to 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 () 'allows the object instance to move. |
| VbCrLf |
Microsoft. VisualBasic. Constants. vbCrLf Microsoft. VisualBasic. vbCrLf |
| Weekday |
Microsoft. VisualBasic. Weekday System. DateTime. DayOfWeek |
| WeekdayName |
Microsoft. VisualBasic. WeekdayName (the System. DateTime constructor does not have the same project) |
| Width attribute |
Control. Size attribute |
| Write # statement |
Microsoft. VisualBasic. FileSystem. Write function |
| Year Function |
System. DateTime. Year attribute |