Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

finishing touches in VB - a lil help

Options
  • 21-04-2004 12:58am
    #1
    Registered Users Posts: 4,946 ✭✭✭


    Alright lads, before i start - nice one for earliers post.

    Right, my program is client and server software for an internet cafe.

    Ive uploaded the working 2 (no flashy parts to it, just what i need) which will allow you to send your variable to and from the server.

    Get it here so you can see what my problem is! :)

    right, to use it - click connect on both server and client which will loop back to each other because i used 127.0.0.1 for the ips.

    Basicly, when you hit the unlock button on the server software - it makes the client software minimise. When you hit lock it just says username and pw wrong and keeps the screen the same size.

    I want to leave out the buttons, so i made a lil if statement to sort that out. there is only one username in the if statement wich when its typed should, but doesnt unlock the machine. Or, if its not reddyrocks, it leaves the client as it is, but with a message box

    Here it is
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    'sets a variable for the arriving data
    Dim TempData As String
    Winsock1.GetData TempData
    Debug.Print TempData
    'puts user login details into the caption
    userdetails.Caption = TempData

    'if the caption equals the database(that word) then unlock client
    If userdetails.Caption = reddyrocks Then
    Dim Data2 As String
    Data2 = "yes"
    Winsock2.SendData Data2
    ElseIf userdetails.Caption = !reddyrocks Then
    'if the caption is not reddy, then lock and prompt.
    Dim Data2 As String
    Data2 = "no"
    Winsock2.SendData Data2
    End If
    End Sub

    also, the code for a cmd button that would start and stop a timer - that would be mint!

    Cheers lads

    reD.


Comments

  • Registered Users Posts: 4,946 ✭✭✭red_ice


    i didnt put " around reddyrocks...

    OMFG!


  • Moderators, Society & Culture Moderators Posts: 2,688 Mod ✭✭✭✭Morpheus


    I wrote a post suggesting that, then i thought i was being stupid and you were using a parameter called reddyrocks so i deleted the post.

    ThankGod it wasnt ME being stupid ;)


  • Registered Users Posts: 4,946 ✭✭✭red_ice


    yea, i really am hitting myself over that one! I guess it was the simplicity of it all that was what i was overlooking :/


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Umm...

    I'd suggest putting "Option Explicit" at the top of the code for each form/module. Then doing things like missing quotes won't cause a problem cause it won't compile :)

    Oh - and there should be an option under Tools/Options somewhere to include that by default on all new forms, classes etc. Require Variable Declaration I think its called.

    jc


Advertisement