Click here to Skip to main content
15,034,598 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
String s = "D//log.txt"; url = new;

I want to convert above code to C#.
Please anybody help me conversion of above code in C#.
I have problem to converting second line in C#

Updated 17-May-11 1:17am

try the following code

Url objUrl = new Url(s);
senguptaamlan 17-May-11 7:49am
@Ramalinga : whats the point of making another persons answer you are not confident enough....don't edit the solution....

The code should be the previous one that I've already written

Uri objUri = new Uri(s);
arindamrudra 17-May-11 8:02am
Amlan da you are correct. O kete dea Url koreche, ota vul. Uri correct (System.Uri).
arindamrudra 17-May-11 8:00am
@Ramalinga you are wrong Uri is the correct one not url(Url), check the msdn, System.Uri and please dont edit the correct answer and make it wrong.
arindamrudra 17-May-11 8:01am
Uri objUri = new Uri(s); Url is wrong here.
Manas Bhardwaj 17-May-11 11:32am
have +5. It would be better if you rollback to your version :)
Sergey Alexandrovich Kryukov 17-May-11 18:27pm
Agree, my 5.
Microsoft has provided a tool called Java Language Conversion Assistant (JLCA). This tool directly converts your Java programs to it's equivalent C# programs. You can find more information at :
Hope this helps you !
yesotaso 17-May-11 16:32pm
Link is dead, though the name JLCA points right direction :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900