Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys,

I tried to get the hdd serial number of computer.But after i add any word to serial number, it makes blank between word and serial why?

for example :
C#
assume that hddSerial = "ABCD";
string NewHddSerial  = hddSerial + "CODEPROJECT" ;

in the textBox , newHddSerial is shown like "ABCD CODEPROJECT" . NOT LIKE "ABCDCODEPROJECT";

And also, what do you suggest me to licence my program for a single computer ?

what a unique value can be used for licence?

please in for me thanks in advance for helping

Respectfully
Berat
Posted
Updated 13-Oct-12 2:33am
v2
Comments
[no name] 13-Oct-12 8:58am    
Please post the real code that demonstrates this string problem that you are experiencing.

1 solution

Your code does not look like that: somehow, either the value you are concatenating on the end or the serial number contains a space - if .NET had a habit of adding spaces it would have been noticed by now!

Use the debugger - put a breakpoint on the line that adds the two strings together and look at the parts you are adding. You will see the space there before they get added together. (You can remove it with the String.Trim method if it is being returned as part of the serial number).

"what do you suggest me to licence my program for a single computer ?"
Don't spend too much time on it. If you make it complex, it will annoy legitimate users, while not inconveniencing the naughty users very much at all. Look at how big companies do it: Photoshop has protection built in, and the new version crackers are available on torrent sites with the ISO images almost the same day. It is very, very easy to spend more time and money on protection than it saves you in income!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900