Important Procedures for an Internet Access Control Application
In the preceding article we started to explore the code that makes up the server communication. If you haven’t read that article, please make sure to do so, because almost everything that I will be discussing in this article will directly reference code that we discussed there. A lot of the things that we will be discussing here will make sense once you have read the previous article.
Important Procedures for an Internet Access Control Application - Taking Names (Page 2 of 5 )
The ‘compname’ variable will take the workstation's name (that is the actual name of the computer that is connecting). At the moment it is commented out for debugging purposes; be sure to uncomment this line when you test the application.
//compname:= GStack.HostByAddress(IP);
The next line of code reads the communication that is sent by the workstation. This will include the name of the workstation. Currently the name is filled in manually, but it will be automatically filled in when you uncomment the line above.
str:=Connection.IOHandler.ReadLn;
//GetComputername+':free@plchldr'
The string is then parsed into different sections using the parse function:
parsestring(str,cmdrslt,cmd,placeholder);
The computer name is then stored in the compname variable:
compname:=cmdrslt;
Then the code checks to see if the name was actually sent. If so, the list view component is updated accordingly: