Hi shvia, I think u are over complicating thins. Star with a small foundation first. U really dont need to use API to connect to a network as u can use the winsock. you can find tutorials on this web site www.winsockvb.com, here is a link to a person to person chat
http://www.winsockvb.com/article.php?article_id=15
Read the tutorial first once u can make a person to person chat, then read the following tutorial
http://www.winsockvb.com/article.php?article_id=18
The tutorial will explain how to make multiple connections to many clients using one server.
After his part u have a foundation of ur network, where by u can pass messages to the server. Meaning all the clinets can pass data to the server.
From this point onwards start the database side. Create a database on the server machine. Every time a client sends the server a message store that message into the database. You can have a string message that is delimtinted using exmaple "-", then use vbs split function to split this string. store each splitted string into ur database.
This should be the process
Client logs onto the program using a pass code. At this stage the program is connected to the server already. (When the computer is switched on ur program should automatically load and connect to the server and remain connected until the computer is switched off)
The clinet will send a message to the server telling the server this is my pass code. The server will look into its database and check to see if that pass code sent by the client is authentic. If it is authentic, the pass code should be associated with a duration time. The reason for this is because if a customer says I want to use internet for 1 hour how will the program know to expire in 1 hour. So Example
passcode:1234 Duration:30 mins
passcode:2332 Duration: 30 mins
pascode:7845 Duration: 1hour
So basiclly each passcode should be assigned with a duration time. So u code generate pass codes that have a duration of 30 mins and passcodes that have a duration of an hour.
Any way after the passcode is authenticated, the server will send the client a message saying, okay ur authenticated and ur duration is 30 mins. The message the server sends to the clinet could look like this "Auth:YES-Dur:1800000". This messages will tell the client computer "YES" code is authentic and duration is "1800000" seconds which is 30 mins.
The user will then be allowed to browse the internet. When 25 mins is gone, tell the customer they have 5 mins left and continue reminding the user possibly with flashing red colored text.
If in the last remaining 5 minutes the customer whats to extend there session buy another 30 mins or an hour. The amin will ask the customer for there passcode, the admin will then find the pass code on the database and add 30 mins or an hour. This update should then automatically be send to the customers computer. the remaining time should then be updated with the new time.
Undertake as much analysis as possible. Remember the last thing u want to do is keep having to modify ur code to add new things that u forgot to add.
You will need to generate a list of pass codes. To make ur system as friendly as possible u should really have a quest system and a membership system. The guest system should use pass codes, where the membership should allow custmers to register and chose a username and password. Ideally, this should be for the regular people who come in often to browse the internet, but i dont know about the setup of the business u are making it for business.
Remember this, when sending messages to the server and server to client, try to send as much information in one trasmit. Meaning if the server is sending a message, dont let the server send 2 different messages one after the other when u can put the 2 messages in one message a transmit. Typically it should be cleint transmit, server transmit, client transmit, server transmit.
This will mean u are sending less packets through the network, where as if u didnt some thing like this
client transmit, client transmit, server transmit, server transmit, client transmit, client transmit, server transmit, server transmits,
U can combine 2 different message sinto one trnamit, to reduce the number of packets being sent through the network, this should avoid packet collision.
Okay I wrote a lot. So plan ur structure out, if u dont do this u will face many probelms. And read those tutorials I gave u.