C# newbie on Wifi Programming

  • Thread starter Thread starter Nighthawk
  • Start date Start date
N

Nighthawk

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.
 
Nighthawk said:
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/library/chfa2zb8(VS.71).aspx

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


-HH-
 
henk holterman said:
Nighthawk said:
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/library/chfa2zb8(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
 
Nighthawk said:
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-
 
henk holterman said:
Nighthawk said:
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 :)
 
Back
Top