Click to See Complete Forum and Search --> : How to Convert to C# ????


karthikeyam
October 16th, 2006, 07:08 AM
hi,

i want the following code to change to C#:

Dim sFullName As String
Dim sUid As String
Dim arrSplit() As String
sFullName = User.Identity.Name
arrSplit = sFullName.Split("\")
sUid = arrSplit(1)

wildfrog
October 16th, 2006, 07:44 AM
Something like this?

string sFullName;
string sUid;
string[] arrSplit;
sFullName = User.Identity.Name;
arrSplit = sFullName.Split("\"); //or double backslash here?
sUid = arrSplit[1];

- petter

Shuja Ali
October 16th, 2006, 07:59 AM
Try the online converter on www.developerfusion.co.uk. Although it sometime gives extra code that is not required but it does come in handy.
http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx

bravey9
October 17th, 2006, 12:21 PM
This is Awsome converter as well with Ajax. It also preserve comments at source language..
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx

RobDog888
October 19th, 2006, 05:31 PM
http://www.tangiblesoftwaresolutions.com/Product_Details/Instant_CSharp/Instant_CSharp.htm

Very accurate and the free version will convert up to 100 lines of code at once.

:)