C# newbie on Wifi Programming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nighthawk

    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.

  • henk holterman

    #2
    Re: C# newbie on Wifi Programming

    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


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


    -HH-



    Comment

    • Nighthawk

      #3
      Re: C# newbie on Wifi Programming


      "henk holterman" <rentahacker@xs 4all.nlwrote in message
      news:4804fa20$0 $14347$e4fe514c @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

      >
      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


      Comment

      • henk holterman

        #4
        Re: C# newbie on Wifi Programming

        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-

        Comment

        • Nighthawk

          #5
          Re: C# newbie on Wifi Programming


          "henk holterman" <rentahacker@xs 4all.nlwrote in message
          news:48066755$0 $14358$e4fe514c @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 :)





          Comment

          Working...