By Jose Mojica
Book Price: $9.95 USD
£6.95 GBP
PDF Price: $7.99
Cover | Table of Contents
Dims. That is true to a certain extent. However,
during that week in front of the firing squad, I discovered that
there were a lot of differences between the two, some really obvious,
and some more subtle.
Dims. That is true to a certain extent. However,
during that week in front of the firing squad, I discovered that
there were a lot of differences between the two, some really obvious,
and some more subtle.
system.console.writeline("hello world")
System.Console.WriteLine("hello world");
Class Account
Overloads Function toString( _
ByVal Format As String) As String
Return "My String with Format"
End Function
Overloads Overrides Function toString( ) As String
Return "My String"
End Function
End Class
Module App
Sub Main( )
Dim acct As Object = New Account( )
System.Console.WriteLine(acct.ToString( ))
End Sub
End Module
class Account
{
}
class Checking : Account
{
}
Inherits keyword:
Class Account
End Class
Class Checking
Inherits Account
End Class
Inherits statement to make the line of code
look more C#-like:
Class Checking : Inherits Account
End Class
Inherits in this fashion is the same as
moving the Inherits clause to the next line
without a colon.
[assembly: AssemblyTitle("")] //C#
<Assembly: AssemblyTitle("")> 'VB
[assembly: AssemblyDescription("")] //C#
<Assembly: AssemblyDescription("")> 'VB
[assembly: AssemblyConfiguration("")] //C#
'VB .NET does not add this attribute
[assembly: AssemblyCompany("")] //C#
<Assembly: AssemblyCompany("")> 'VB
[assembly: AssemblyProduct("")] //C#
<Assembly: AssemblyProduct("")> 'VB
[assembly: AssemblyCopyright("")] //C#
<Assembly: AssemblyCopyright("")> 'VB
[assembly: AssemblyTrademark("")] //C#
<Assembly: AssemblyTrademark("")> 'VB
[assembly: AssemblyCulture("")] //C#
'VB does not add this attribute
//C# does not add this attribute
<Assembly:CLSCompliant(True)> 'VB
//C# does not add this attribute
<Assembly: Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")> 'VB
[assembly: AssemblyVersion("1.0.*")] //C#
<Assembly: AssemblyVersion("1.0.*")> 'VB
[assembly: AssemblyDelaySign(false)] //C#
'VB does not add this attribute
[assembly: AssemblyKeyFile("")] //C#
'VB does not add this attribute
[assembly: AssemblyKeyName("")] //C#
'VB does not add this attribute
class Class1
{
static unsafe void Main(string[] args)
{
//who says strings cannot be changed
string sName = "Joseph Mojica";
fixed (char *Temp = sName)
{
char *ch = Temp;
ch += 4;
*ch = (char)0;
ch += 1;
*ch = (char)0;
}
System.Console.WriteLine(sName);
}
}
fixed keyword. fixed pins a
variable to a certain location of memory so that if garbage
collection occurs, the collector will not move the contents of memory
that the variable points to to another location.
Return to C# & VB.NET Conversion Pocket Reference