Click here to Skip to main content
13,248,562 members (57,392 online)
Rate this:
Please Sign up or sign in to 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 :
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

Posted 13-Oct-12 3:28am
Updated 13-Oct-12 3:33am
Wes Aday 13-Oct-12 8:58am
Please post the real code that demonstrates this string problem that you are experiencing.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 13 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100