How to use Network Client and stream parsing stuff...

Discussion in 'Questions (Windows Mobile)' started by apstrojny2, Apr 27, 2009.

  1. apstrojny2

    apstrojny2 Member Licensed User

    My problem is that I'm can't understand how to use the Network Client object... The example in the help is not complete enough because of syntax errors or I do not know how to include or use the client object correctly... The manual or help is just a bit weak for me, the uninformed, and new to B4P...

    This is what I want to do...
    I want to write a nice little Pocket PC app to file my Faa Flight Plan or get a Faa weather briefing.. The FAA uses a web site (www duats com)
    CSC DUATS on the Web port 23....

    I wanted to use the Network Client services of Basic for Pocket PC...

    Once you connect to port 23 you will get

    CSC DUAT System

    Session number: 00370

    Enter DUAT access code -or- last name: { Now I need parse the stream and then Auto Fill in the my Access Code [CR]...}

    {Then you will get}

    Enter your password: { Parse and Auto Fill in my Password[CR]}

    Then it will list...

    DUAT Main Menu

    Weather Briefing 1
    Flight Plan and Planner 2
    Encode 3
    Decode 4
    Modify Personal Data Profile 5
    Service Information 6
    Extended Decode 7
    FAA/NWS Contractions 8

    Select function (or 'Q' to quit): { Parse and I want to sent the Quick File request to get a weather briefing or file a flight plan etc...}

    Take this result and save it in a text file and then launch the Windows Mobile Word app so I can review the weather in that text file...

    So if someone could get me going that would be awesome...

    Thanks again,

  2. Erel

    Erel Administrator Staff Member Licensed User

    I'm not sure if I understand this scenario.
    Do you need to interact with a web server? Or you want to write the server code?
  3. apstrojny2

    apstrojny2 Member Licensed User

    The B4ppc is the Client Side

    Hi Erel,

    1) I think this Platform is just Awesome!!! It works really nice!!! I wrote some nice weight and balance programs... I just need need to learn more about the librarys and objects... I was a C programmer but never got into C++ thats probably my biggest problem... Any advice will be greatly appreciated or would you recommend a book...

    2) Also how can you get a description on the librarys or library help...

    3) I'm writing the Client Side... So it must parse the character stream for the Name: and Password:....

    4) I tried to get the a look at the but when I click on it it is a dead link... I looked at ChitChat so I got it going sorta... Could you make available for me?

    5) I can't seem to find a description on 'Stream' 'Client' objects and operations... Searching help did not help... The problem is that I need to sift through the buffer character by characters for name: and password: on a character level instead of a string level just incase the item name: or Password: comes in split across two buffer reads... I got it going with this StrIndexOf:

    if client.DataAvailable = True Then
    Dim bufferbits(8192) As byte
    count = stream.ReadBytes(bufferbits(),8192)
    buffer = bit.BytesToString(bufferbits(),0,count)


    ' State = 1 (Look for Name:) if found then reply with Username'

    If State = 1 Then
    If -1 < StrIndexOf (buffer, "e:",0) Then

    stream.WriteBytes (stream.StringToBytes(Uname.text & Chr(10)))

    State = 2 'Change State Next State = 2 (Look for Password:)'
    End If
    End If

    6) I can send you the code if you prefer... But you will have to tell me how to attach it...

    Thanks again,

  4. Erel

    Erel Administrator Staff Member Licensed User

  5. apstrojny2

    apstrojny2 Member Licensed User

    Can't find Client or Stream anywhere in the docs

    Hi Erel,

    Can't find Client or Stream anywhere in the docs...
    I have the pdf reference... I checked out the tutorials... ChitChat helped...

    Would the which had a dead link help... Code to follow..


  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice