Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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
 
Respectfully
Berat
Posted 13-Oct-12 2:28am
beratxt661
Edited 13-Oct-12 2:33am
v2
Comments
Wes Aday at 13-Oct-12 8:58am
   
Please post the real code that demonstrates this string problem that you are experiencing.

1 solution

Rate this: bad
good
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!
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 901
1 OriginalGriff 445
2 CPallini 255
3 Richard Deeming 175
4 George Jonsson 161
0 OriginalGriff 5,540
1 Sergey Alexandrovich Kryukov 4,668
2 CPallini 4,540
3 George Jonsson 3,102
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 13 Oct 2012
Copyright © CodeProject, 1999-2014
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