Hi,

How can I use a VB.Net function in a C# project. Is there a way to call it
directly from code? thx juvi

Re: How to use VB.Net functions in C# project? by Tim

Tim
Fri Sep 23 07:20:08 CDT 2005

If you're inquiring about using the "built-in" Microsoft VB functions from
C# then you'll need to add a reference to the "Microsoft.VisualBasic.dll"
assembly. From there you'll be able to access certain functions such as
MsgBox...

Microsoft.VisualBasic.Interaction.MsgBox(...);

If you're asking how to call you're own functions that you've authored in
VB.NET, then you'll need to compile them into a class lib project and then
add the resulting assembly as a reference in your C# project.

--
Tim Wilson
.Net Compact Framework MVP

"juvi" <juvi@discussions.microsoft.com> wrote in message
news:D6E5C9AC-D927-4D3D-914A-C6D4DFC0C782@microsoft.com...
> Hi,
>
> How can I use a VB.Net function in a C# project. Is there a way to call it
> directly from code? thx juvi



RE: How to use VB.Net functions in C# project? by NoSpamMgbworld

NoSpamMgbworld
Fri Sep 23 07:50:02 CDT 2005

1. Compile it and make reference to the compiled library
2. Convert to C# :-)
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"juvi" wrote:

> Hi,
>
> How can I use a VB.Net function in a C# project. Is there a way to call it
> directly from code? thx juvi

RE: How to use VB.Net functions in C# project? by juvi

juvi
Fri Sep 23 08:19:02 CDT 2005

Thank you for your quick reply. I am new to .net developement. I tried it
with the code translator but the Rnd() function is still unknown.

How would you translate this code: MyValue = CInt(Int((6 * Rnd()) + 1))

thank you! juvi

--------------------------------------
"Cowboy (Gregory A. Beamer) - MVP" wrote:

> 1. Compile it and make reference to the compiled library
> 2. Convert to C# :-)
> http://www.carlosag.net/Tools/CodeTranslator/Default.aspx
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "juvi" wrote:
>
> > Hi,
> >
> > How can I use a VB.Net function in a C# project. Is there a way to call it
> > directly from code? thx juvi

RE: How to use VB.Net functions in C# project? by Sukhdev

Sukhdev
Fri Sep 23 14:17:03 CDT 2005

You can use following csharp code for this:

System.Random rr = new System.Random();
MyValue = rr.Next(1, 6);

Sukhdev

"juvi" wrote:

> Thank you for your quick reply. I am new to .net developement. I tried it
> with the code translator but the Rnd() function is still unknown.
>
> How would you translate this code: MyValue = CInt(Int((6 * Rnd()) + 1))
>
> thank you! juvi
>
> --------------------------------------
> "Cowboy (Gregory A. Beamer) - MVP" wrote:
>
> > 1. Compile it and make reference to the compiled library
> > 2. Convert to C# :-)
> > http://www.carlosag.net/Tools/CodeTranslator/Default.aspx
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> >
> > ***************************
> > Think Outside the Box!
> > ***************************
> >
> >
> > "juvi" wrote:
> >
> > > Hi,
> > >
> > > How can I use a VB.Net function in a C# project. Is there a way to call it
> > > directly from code? thx juvi