Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I want to write a desktop application with C#. But, this program will send sms to mobile devices. Sms gateway provider has api only for VB. Can I code most of the project with C# and code sms part in VB?
Posted
Updated 7-Sep-11 5:46am
v2
Comments
Rob Philpott 7-Sep-11 11:39am    
When you say VB, do you mean VB6 or VB.NET?
Çağlar Tolga Tetik 8-Sep-11 3:26am    
VB.NET

Any .Net assembly can be referenced in any .Net language

So yes, you can add a reference to a VB.Net DLL in your C# project
 
Share this answer
 
Comments
Mehdi Gholam 7-Sep-11 10:51am    
Hehe, just posted the same at the same time, 5!
GParkings 7-Sep-11 11:30am    
yup .. dead on, 5 from me too (did it earlier in fact :))
.net languages all compile down to IL so it makes no difference in what language you work in.

That being said if you are comfortable in c# but your library is in VB, create a DLL from that library and reference that DLL in your c# projects and you won't know the difference.
 
Share this answer
 
It is likely that the "example" code using their API is written in VB, however .Net does not care what language you use.

This means that you can reference their assemblie and use any .Net compliant language(F#, C# etc.) You do not ever need to code any VB.

Create a solution/project as you would normally (C# I assume) and then reference the dlls. You can then use their API with C# notation.

If you are stuck on their provided examples you can convert them using an online
converter[^].
 
Share this answer
 
Comments
GParkings 7-Sep-11 11:45am    
have a 5 for the converter link, though you were beaten to the solution by a good half hour ;p
[no name] 7-Sep-11 12:28pm    
Thank you :)

Technically this one is still 'open' (no solution marked)
GParkings 7-Sep-11 12:34pm    
yes thats true. But there were 2 existing solutions almost identical to yours before you added yours. To be honest, just one of these 3 solutions would suffice and the other 2 are redundant, myself and Mehdi posted at almost exactly the same time so that duplication was unfortunate. The third repition was avoidable ;p but, as i said, i like the addition of the converter link :D
[no name] 7-Sep-11 13:13pm    
Suffice is one thing but a clear reasoning of why or how is another. I beleived the OP might need a little more info than the solutions that were provided. Honestly, the 'correct' soulution would be "Yes" based on the question. However, that is a bad answer IMO. Often a poster asks the simple question (because that is what gets responces quickly), but they really need a little more info. Such as the why and how. I provided these in addition to the "Yes".

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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