Convert C# to Vb.NET

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
 
H

Herfried K. Wagner [MVP]

* "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
///
 
J

Jay B. Harlow [MVP - Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top