How to convert VB to C#

Posted by Oswaldlily under ASP.NET on 2/3/2012 | Points: 10 | Views : 1285 | Status : [Member] | Replies : 3
ByVal fileextension As String

If UCase(fileextension) = ".XLS" Then

...........
end if


How to convert this into C#?




Responses

Posted by: Naidulaxmi on: 2/3/2012 [Member] Starter | Points: 25

Up
0
Down
hi,


using this link "http://www.developerfusion.com/tools/convert/vb-to-csharp/ " easily converted to c#.


Thanks&Regards
Appalanaidu,
jr.Software Engineer.

appalanaidu

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhimurthyd on: 2/3/2012 [Member] Starter | Points: 25

Up
0
Down
Check with this converted Code

ByVal fileextension As String ==> string fileExtensions

If UCase(fileextension) = ".XLS" Then ==> if(string.Equals(fileExtensions , ".xls" , StringComparison.OrdinalIgnoreCase)


finally, if it's method then it be like as
private void MethodName(string fileExtensions)
{
if(string.Equals(fileExtensions , ".xls" , StringComparison.OrdinalIgnoreCase)
{

}
}



Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 2/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
try this way
 If (fileExtension.ToUpper() ==  ".XLS")

{
}
end if


Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response