471,348 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

C# newbie on Wifi Programming

Hi,

I do have some experience in programming in C# but mainly with database.
Now I am trying to learn some systems programming. I am trying to do some
project on WiFi radar to begin with.

I found the APIs at http://msdn2.microsoft.com/en-us/library/ms706783.aspx
But I am not sure how to use them. Do I need to install additional header
files/ libraries/DLLs?

Basically, how do I get start using those APIs?

Any link or suggestion is highly appreciated.

thank you.

Jun 27 '08 #1
4 10222
Nighthawk wrote:
>
I found the APIs at http://msdn2.microsoft.com/en-us/library/ms706783.aspx
But I am not sure how to use them. Do I need to install additional
header files/ libraries/DLLs?

Basically, how do I get start using those APIs?
I don't have any code samples at hand. But the following may get you
started:

You will need to explore the [Unsafe] side of C#. This will give you
C-like pointers. See
http://msdn2.microsoft.com/en-us/lib...b8(VS.71).aspx

Also have a look at the [StructLayout] attribute. You will need to
convert the C[++] structs to C#.
-HH-

Jun 27 '08 #2

"henk holterman" <re*********@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl...
Nighthawk wrote:
>>
I found the APIs at
http://msdn2.microsoft.com/en-us/library/ms706783.aspx
But I am not sure how to use them. Do I need to install additional header
files/ libraries/DLLs?

Basically, how do I get start using those APIs?

I don't have any code samples at hand. But the following may get you
started:

You will need to explore the [Unsafe] side of C#. This will give you
C-like pointers. See
http://msdn2.microsoft.com/en-us/lib...b8(VS.71).aspx

Also have a look at the [StructLayout] attribute. You will need to convert
the C[++] structs to C#.
-HH-

Thanks HH

That was very informative. I didn't know we can use pointers as in C! in C#.

But first I am not able to use NativeWifi. I tried putting "Using
NativeWifi" in my C# code but it throws error right there.

I think I will need to add reference to my application. I don't know which
dll i need to import.

I have installed Windows SDK. Tried searching for Nativewifi.dll but could
not find it. There is a file Nativewifi.hxs but I don't know what that is or
how to use it.

Please help me get started.

thanks
Jun 27 '08 #3
Nighthawk wrote:
>
But first I am not able to use NativeWifi. I tried putting "Using
NativeWifi" in my C# code but it throws error right there.

I think I will need to add reference to my application. I don't know
which dll i need to import.

I have installed Windows SDK. Tried searching for Nativewifi.dll but
could not find it. There is a file Nativewifi.hxs but I don't know what
that is or how to use it.

Please help me get started.

Nighthawk,

Nativewifi.hxs is some sort of compiled helpfile (part of MSDN)

You'll need to look for ndisXXX.h files, they are installed as part of
the Mobile SDK. (Probably somewhere under Program Files). But maybe only
if you opted to include C++ development.

When you've found the headers you will have to import the functions (see
the ImportDll attribute) and translate the struct definitons into
equivalent C# code. There may exist tools for that, but if you need only
a few you might try it by hand. It will take some learning.

Personally I am impressed with the tools C# offers (like
[FieldOffset()]) but it will be of little help until you understand C
structs and the typical WinAPI types. Note that C or C++ hardly matters
here.


-HH-
Jun 27 '08 #4

"henk holterman" <re*********@xs4all.nlwrote in message
news:48***********************@news.xs4all.nl...
Nighthawk wrote:
>>
But first I am not able to use NativeWifi. I tried putting "Using
NativeWifi" in my C# code but it throws error right there.

I think I will need to add reference to my application. I don't know
which dll i need to import.

I have installed Windows SDK. Tried searching for Nativewifi.dll but
could not find it. There is a file Nativewifi.hxs but I don't know what
that is or how to use it.

Please help me get started.


Nighthawk,

Nativewifi.hxs is some sort of compiled helpfile (part of MSDN)

You'll need to look for ndisXXX.h files, they are installed as part of the
Mobile SDK. (Probably somewhere under Program Files). But maybe only if
you opted to include C++ development.

When you've found the headers you will have to import the functions (see
the ImportDll attribute) and translate the struct definitons into
equivalent C# code. There may exist tools for that, but if you need only a
few you might try it by hand. It will take some learning.

Personally I am impressed with the tools C# offers (like [FieldOffset()])
but it will be of little help until you understand C structs and the
typical WinAPI types. Note that C or C++ hardly matters here.


-HH-
Thanks a lot. Now I am getting what you have been trying to tell me :)

And I found this site http://www.codeplex.com/managedwifi I guess he has
done all what you were trying to tell me, if I am correct.

With that code I have taken a step further in my project and now I can scan
and see the list of APs and then continue further.
It has been good learning experience !

Can you please suggest me a book that covers these advance topics and not
database or web apps :)

Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jon Vaughan | last post: by
4 posts views Thread by marmar12 | last post: by
16 posts views Thread by Raxit | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.