Click here to Skip to main content
16,013,581 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello
please i am having a code in vb.net that i need to convert it to C# and i tried an online converter but the code doesn't work
here is the vb.net code
VB
Dim connection As IConnection = New RIMRadioObj
Dim imei As IReadIMEI = New RIMRadioObj

Thanks in Advance
Waiting For your reply
Posted

OriginalGriff already solved your problem and have given a great link for Code Conversion. I will also suggest you to use http://converter.telerik.com/[^] to convert code from C# to Vb.Net and Vice Versa VB.Net to C# for your your future accomplishment.
 
Share this answer
 
It's pretty easy:
IConnection connection = new RIMRadioObj();
IReadIMEI imei = new RIMRadioObj();
I don't know which online converter you are using, this one[^] worked it out...
 
Share this answer
 
Comments
Seif Hatem 25-Sep-11 11:57am    
i used this one and it gives me this error
Error 1 Cannot implicitly convert type 'RIMRADIOCOMLib.RIMRadioObj' to 'RIMRADIOCOMLib.IConnection'. An explicit conversion exists (are you missing a cast?) C:\Users\Seif\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs 22 38 WindowsFormsApplication1

Please Help
Thanks in advance
OriginalGriff 25-Sep-11 12:02pm    
When it says "An explicit conversion exists" it means that it wants you to be aware that you may not have meant what to entered, but if you did, you can explicitly say so by casting the value before assignment:
IConnection connection = (IConnection) new RIMRadioObj();
Seif Hatem 25-Sep-11 12:20pm    
Thanks this worked
Seif Hatem 25-Sep-11 12:27pm    
Please can you help with this error
Error 1 Cannot assign to 'GetStatus' because it is a 'method group' C:\Users\Seif\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs 27 6 WindowsFormsApplication1
OriginalGriff 25-Sep-11 15:06pm    
Without your code? No - I'd have to guess! :laugh:

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