get return value by passing parameters to a URL?

  • Thread starter Thread starter Guest
  • Start date Start date
Tom said:
In VB6, I can use OpenURL

.... which is an API and could thus be used in .NET as well via PInvoke.
Which library can I use in C#?

Does VB.net has that library and I can add it to C# to call a VB method?

Well, I use the following VB.NET code:

\\\
Dim SomeData As String = _
System.Text.Encoding.Default.GetString( _
(New Net.WebClient).DownloadData(SomeUrl) _
)
///

which makes use of the System.Net.WebClient-class.

an equivalent in C# would be:

\\\
string SomeData =
System.Text.Encoding.Default.GetString(
(new Net.WebClient).DownloadData(SomeUrl)
);
///

.... which visibly isn't all that different.
 
To elaborate, it should be noted that the WebClient uses the
HttpWebRequest and HttpWebResponse classes to perform its work, and if more
control over the download process is needed, then these classes would be
what you want.

Also, to answer the OP's second question, Visual Basic has most if the
functions that it exposes available through the classes in the
Microsoft.VisualBasic.dll assembly. This is shipped with the .NET framework
as a standard piece, so there should be no concern about using them (at
least, deployment concerns, concern over implementation of those functions
is a different thing).

Hope this helps.
 
Back
Top