I am looking for some help on how to detect "Control Characters" once I receive HostName inside program, I am getting string, I am using SetComputerName Ex to set HostName, buit some times if any Control Characters present, I need to send error back. Here "str" carried string (HostName), sometimes it might contain Control characters (/\\|<>+=;,?), I need to detect and send error, how can I detect.
Code:
MessageBox.Box(" Received Host Name " + str);
SetComputerNameEx(GCInfo.COMPUTER_NAME_FORMAT.ComputerNamePhysicalNetBIOS, str));
SetComputerNameEx(GCInfo.COMPUTER_NAME_FORMAT.ComputerNamePhysicalDnsHostname, str))
Comment