![simply fortran registraion key simply fortran registraion key](https://img.52z.com/upload/info/20190301/201903011110147412.png)
(void)LookupAccountName(NULL,ComputerName, If( GetComputerName(ComputerName, &ComputerNameLen)) TCHAR ComputerName ĭWORD ComputerNameLen = sizeof(ComputerName) Get the SID (system identification) string If( RegQueryValueEx(hKey, kValueName, NULL, NULL, (unsigned char *)sPidStr, &dwSize) = ERROR_SUCCESS )Ĭhar *str = strtok_s(sPidStr+8, "-", &context) If( RegQueryValueEx(hKey, kValueName, NULL, &dwType, NULL, NULL) = ERROR_SUCCESS ) If( RegOpenKeyEx(HKEY_LOCAL_MACHINE, kSubKey, 0, KEY_QUERY_VALUE|KEY_WOW64_64KEY, &hKey) = ERROR_SUCCESS ) Get the PID (Product Id) string from the registryĬonst TCHAR kSubKey = _T("SOFTWAREMICROSOFTWindows NTCurrentVersion") Ĭonst TCHAR kValueName = _T("DigitalProductId")
![simply fortran registraion key simply fortran registraion key](https://images.sftcdn.net/images/t_app-cover-l,f_auto/p/d1d5169a-a4d4-11e6-8c86-00163ed833e7/2888744156/simply-fortran-screenshot.png)
Error handling and conversion to Fortran is left as an exercise for the reader.
Simply fortran registraion key code#
The Windows system identification number (SID) and program identification number (PID)are useful when trying to uniquely identify a Windows machine.Here's some C++ code to get these numbers. Moreover it is to identify, the machine or data of a specific machine. The mac-address, machine identification (for licence checking)is not the main goal. So I think for the purpose of our software, the pirate copy protection is sufficient.
![simply fortran registraion key simply fortran registraion key](http://compinfo.ge/compinfo/pic/op_system/Win_inst_21.gif)
If that is not the problem then, if you tell us what you want to achieve, maybe someone here will be able to help. It may deter a casual user but not adetermined effort. If your intention is to prevent pirate copyingof your software, then the general concensus (that I have seen)is that a "home grown" solution will not be good enough.