Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Domain network

imeca
Beginner
486 Views
Hello everybody,
can any one help me find the way to detect the name of the domain to which the PC belongs.
my purpose is to check wether the user of my application belongs to a specific domain. if that is not the case, an error will thrown and the use of the application will be blocked.
It is a way to make sure that the application i am working on, will not go out the society to which i am developping.

thank you in advance.
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
486 Views
Quoting - imeca
Hello everybody,
can any one help me find the way to detect the name of the domain to which the PC belongs.
my purpose is to check wether the user of my application belongs to a specific domain. if that is not the case, an error will thrown and the use of the application will be blocked.
It is a way to make sure that the application i am working on, will not go out the society to which i am developping.

thank you in advance.

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/12320.mspx?mfr=true

To read the information from registry, use RegOpenKey[Ex], RegQueryValue[Ex] and RegCloseKey (use IFWIN).
0 Kudos
imeca
Beginner
486 Views
Quoting - Jugoslav Dujic

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/regentry/12320.mspx?mfr=true

To read the information from registry, use RegOpenKey[Ex], RegQueryValue[Ex] and RegCloseKey (use IFWIN).

Thanks Jugoslav for your answer, but can i ask you to provide me with a little example showing the use of such instructions
0 Kudos
Jugoslav_Dujic
Valued Contributor II
486 Views
Quoting - imeca

Thanks Jugoslav for your answer, but can i ask you to provide me with a little example showing the use of such instructions

Here's a quick one:

http://software.intel.com/en-us/forums/showthread.php?t=45725

Note that they forgot to call RegCloseKey. Pay attention that "Key" should be a C-style string, i.e. "SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"//char(0)
0 Kudos
imeca
Beginner
486 Views
Quoting - Jugoslav Dujic

Here's a quick one:

http://software.intel.com/en-us/forums/showthread.php?t=45725

Note that they forgot to call RegCloseKey. Pay attention that "Key" should be a C-style string, i.e. "SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon"//char(0)

thank you again yugoslave,
since i am not a programmer originally, i couldn't take advantage of the link you suggested to me.
however, i used another way. Probably it is a longer way, but it worked fine.
i used a dos instruction (net config workstation) through the fortran code. I asked the code to get the result in a file. all what i had to do, then,is to read that file and stop at the line beginning with "workstation domain" and get the domain name i am searching for.
0 Kudos
Reply