thanks for reply Lars-Inge Tønnessen
Yes WebClient class of .NET works fine, Is it only way to
connect to HTTP server. Can't we use Java code as it is.
Regards
Ahmad Raza
>-----Original Message-----
>
[quoted text clipped - 17 lines]
> stream.Close();
> //
_______________________________________________________
> // The java way...
> try
[quoted text clipped - 12 lines]
> }
> //
_____________________________________________________
> }
>
[quoted text clipped - 9 lines]
>
>.
Lars-Inge T?nnessen [VJ# MVP] - 20 Sep 2004 18:24 GMT
Hi Ahmad,
Yes, you can use java source code in J#. You can use both .net and java.
Please see my second example in the reply above (also included below in this
post). Please include a complete example if you want us to take a look at
your code.
public class Class1
{
public Class1()
{
// The java way...
try
{
java.net.URL url2 = new java.net.URL( "http://localhost/filename" );
java.io.BufferedReader BReader =
new java.io.BufferedReader(
new java.io.InputStreamReader( url2.openStream() ));
String line2 = new String("");
while ( (line2 = BReader.readLine()) != null )
System.out.println( line2 );
BReader.close();
}
catch ( Exception e )
{
e.printStackTrace();
}
}
/** @attribute System.STAThread() */
public static void main(String[] args)
{
new Class1();
}
}
Regards,
Lars-Inge T?nnessen