Skip to Main Content
VB.Net Web Developer's Guide
book

VB.Net Web Developer's Guide

by Syngress
September 2001
Intermediate to advanced content levelIntermediate to advanced
608 pages
23h 46m
English
Syngress
Content preview from VB.Net Web Developer's Guide
662 Chapter 14 • Upgrading Visual Basic Applications to .NET
Sub DisplayUserName()
Dim strUserName As String
strUserName = String(20, " ")
Module1.GetUserName strUserName, 20
MsgBox strUserName
End Sub
After the upgrade, the code is transformed into:
Public Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA"(ByVal lpBuffer As String, ByRef nSize As Integer) As
Integer
Sub DisplayUserName()
Dim strUserName As String
strUserName = New String(CChar(" "), 20)
Module1.GetUserName(strUserName, 20)
MsgBox(strUserName)
End Sub
Note the differences between the code written in Visual Basic 6.0 and that
written in Visual Basic .NET:
The nSize parameter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VB.NET Core Classes in a Nutshell

VB.NET Core Classes in a Nutshell

Budi Kurniawan, Ted Neward

Publisher Resources

ISBN: 9781928994480