| 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 Change 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 size") '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 Change 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. Width Others |
| 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 attributes 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 be moved. |
| 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 |