Convert C# to Vb.NET

  • Thread starter Thread starter Andrea
  • Start date Start date
A

Andrea

Hi all.
I need to use in my VB.NET applications some DLLs, running well under C#.
So, the "problem" is to port under VB.NET all functions and declarations
available under C# (at least!).
Here below some code for C#:


public struct NNTPDefaults
{
public const string ContentType = "text/plain";
public const string Charset = "us-ascii";
}

How I can convert C# code to its equivalent in VB.NET ?

Many thanks.
Andrea
 
* "Andrea said:
I need to use in my VB.NET applications some DLLs, running well under C#.
So, the "problem" is to port under VB.NET all functions and declarations
available under C# (at least!).
Here below some code for C#:


public struct NNTPDefaults
{
public const string ContentType = "text/plain";
public const string Charset = "us-ascii";
}

\\\
Public Structure NNTPDefaults
Public Const ContentType As String = "text/plain"
Public Const Charset = "us-ascii"
Public Foo As Integer
End Structure
///
 
Andrea,
In addition to the other comments.

If you have a DLL that is running well under C#, why not simply reference
the same DLL from VB.NET and continue to use the C# DLL?

One of the major strengths of .NET is the interoperability between
languages. Class Libraries written in C# can easily be used in VB.NET and
visa versa. The only real requirement is that you write the Class Library to
be CLS compliant (which for the most part is following the Design Guidelines
for Class Library Developers:
http://msdn.microsoft.com/library/d...ef/html/cpconNETFrameworkDesignGuidelines.asp)

Hope this helps
Jay
 
Back
Top