Answered by:
how to call API for my windows forms application?

Question
-
Hi,
I developed one project. In this one requirement i want.
I have API of Vinplus manufactured by L&T.
HOW TO call that API or use in our winforms apps.
thanks and regards,
dhayanand
Wednesday, January 30, 2013 5:42 AM
Answers
-
Hi,
if the vendor provided some .Net assemblies then you should simply take the DLLs (The exe files are executables that you normaly do not reference!) and do the following steps:
- Copy the files to your solution (we normaly create a dependencies subfolder to store them)
- Inside the projects where you want to use the API: Add a reference to the assemblies (simply browse to the DLLs and add the reference)
- Inside the code you simply add a using statement to include the namespace of the classes you want to use.With kind regards,
Konrad
- Marked as answer by Dhayanand-Kalimidi Saturday, February 2, 2013 11:15 AM
Wednesday, January 30, 2013 12:21 PM
All replies
-
Hi,
can you give more details about the API? What kind of API is it?
- Maybe it is already a .Net API which means they deliver a .Net assembly. You can simply add the DLL to your solution and add a reference in your projects.
- Maybe they provide a PowerShell API? PowerShell Extensions are also .Net assemblies. It is possible to get the DLL from the PowerShell API and do the steps above with it. (At least it worked for the stuff where we required access,)
- Maybe the API is a COM Component. That can be included in your projects, too.
- it could be a simple Win32 DLL. Then you can use Platform Invoke to access it.
It is important that you give us more details about the API you want to use so we can give deeper explanations (or links that describe how to do it).
A good forum could be the forum of the language you want to use e.g. the C# or VB.Net general forum.
With kind regards,
Konrad
- Proposed as answer by Zoltán HorváthMVP Wednesday, January 30, 2013 10:00 AM
Wednesday, January 30, 2013 5:51 AM -
that all are .net assembly
and they gave some of exe files
i done like this
am adding that dlls and exes to my project.
Wednesday, January 30, 2013 11:47 AM -
Hi,
if the vendor provided some .Net assemblies then you should simply take the DLLs (The exe files are executables that you normaly do not reference!) and do the following steps:
- Copy the files to your solution (we normaly create a dependencies subfolder to store them)
- Inside the projects where you want to use the API: Add a reference to the assemblies (simply browse to the DLLs and add the reference)
- Inside the code you simply add a using statement to include the namespace of the classes you want to use.With kind regards,
Konrad
- Marked as answer by Dhayanand-Kalimidi Saturday, February 2, 2013 11:15 AM
Wednesday, January 30, 2013 12:21 PM -
Hi, Mr Konrad.
You gave good guidance regarding
how to Call APIs.
-I solved my requirement.
Its good way to call the API TO our apps
Thanks and Regards,
dhayanand
Saturday, February 2, 2013 11:18 AM