I am curious if there is a simple way to identify a system that a VS2005 VB application is connecting to. Using "windows login validation" types of things is not an option.
I notice there is a registry key in the local machine, software, microsoft, mslicensing called "HardwareID". Would there be any security concerns accessing this value from within a program and would it be unique to a machine Does it change
If thats not the right place to be doing this (and I am trying to avoid making a new entry someplace if possible) then is there an alternate or better approach
Thanks in advance! :)

Simple security validation
m_3ryan
thats pretty much how you would call it. The other one is using dll import:
http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfSystemRuntimeInteropServicesDllImportAttributeClassTopic.asp
in regards to "whats available" im not really sure.
www.pinvoke.net
has some general functions available, most of them dont come with VB.NET examples/declerations but only C#, which is easily translatable to VB.NET
just did a quick search and this came up:
http://www.nirsoft.net/utils/dll_export_viewer.html
could be something useful to obtain the available API's in the specific dll that exposes the API's you are after, then do some more search on seeing how to use it perhaps or look on the MSDN to see its usage (msdn.microsoft.com and just do a search)
limssd
accessing registry's should be a very last resort as the user account may not have priviledges to read or write to the registry. You could use WMI to gain unique ID's for the computer such as the CPU ID but not the hard disk ID as hard disks can be replaced easily than CPU's most of the time.
what exactly are you trying to do make sure your app runs in one computer only There are a few topics about such things on the forums if you can do a search :-)
take a look at this:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=845223&SiteID=1
MartinMalek
no worries. I was under the impression that the CPUID would be the unique ID of that CPU - serial number.
http://msdn.microsoft.com/library/default.asp url=/library/en-us/wmisdk/wmi/win32_processor.asp
I guess the other thing is to take the HDD ID but as it was stated earlier, it can be easily replacable.
GazCoder
Thanks for the fast response. I've looked at the link, and some of the information there should prove to be useful. :)
The application will be running on a small busisness network, connected via the internet, and will send small amounts of data from remote sites. Since the computers used will have various users opertaing them, and can connect from various locations as the equipment is moved, the customer wants to have something thats simple for their people to use without getting into security certificates and complex validation and authorization proceedures. And since it could be installed on multiple machines, it is important to identify the machine it is coming from.
It looks like the cpuid is one possible answer, and its not one that would be normally modified by anyone playing around with things they shouldn't be playing around with, and from the concept of a hardware identification, its also something that shouldn't be "spoofed" or duplicated.
Thanks for the suggestion.
JRGuilbault
Found the references, and certainly some very interesting things. I have been playing with a few of them (geez, these are not simple objects to deal with LOL) with some success and, sadly, some failures.
A few of the systems are of the Win98/95 side of things and it seems that the WMI functions won't work well on those machines. I have been exploring more of the forums and have noticed that there are several function references to the Lib Kernel32. I have tried looking in the VS2005 object browser and help files for information on the functions available and how to call them and for the life of me I can't seem to locate anything on it. :)
When you stop laughing at my obvious inexperience in this area, smack me on the head for not being able to find something that should be fairly simple... May I ask once again for a pointer to where I can find out information on this Library and the functions supported When I know where it is, I can make the external calls and formatting etc. I am sure that once I HOW to look for these things, I will find all kinds of other goodies I can also use and explore, and start learning a little more indepth.
Thanks again for your patience and understanding. :)
Farhan H Soomro
no worries. I agree, the CPUID would be one of the unique ID's you can use as well as being one which cannot be spoofed. you could also use say, get a collection of NIC's and their MAC Address but you can have more than 1 NIC on your system so it wouldnt be a good overall solution.
hard disk serial number, CPUID as well as perhaps the Windows Serial Number (NOT product key) in the Win32_OperatingSystem (field: SerialNumber) could be another possibility of uniqueness you can have for the system
EWANAME
Excellent. I'll hunt around, and if I find anything that gives more specifics, I'll come back and post a link for it. I'm sure with all of the pointers you have so kindly provided that I will get at least some information.
Thanks again, you've been most helpful.
goh6613
Yes, its the list of what is available for those "older" functions. This was an example from one of the other forums...
Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Integer, ByRef lpVolumeSerialNumber As Integer, ByVal lpMaximumComponentLength As Integer, ByVal lpFileSystemFlags As Integer, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Integer) As IntegerI suspect that there are several others which may give me more suitable generic information. The key question, is knowing what is available, and how they are called. :)
lifeamit
Sorry to be a bother again. :) I have been using the ProcessorID side and I am running into a little bit of a problem. I am sure that it is just me not understanding the WMI side of things and what everything means. I've been looking in the VS help files and I guess I am not digging down into the right places.
I was assuming that the ProcessorID would be unique, like a serial number. But for some reason several of the systems are returning the same value so does it mean that is the same Processor type (as in maybe a AMD 3000) rather than the serial number of the processor itself Or does it mean that the BIOS has been set to hide the CPU serial number and this generic value is returned instead.
I tried looking in the help files for the WIN32_Processor information, and that doesn't exist. I am not sure of the various select statements that can be used and what information is available. Would you be so kind as to point me to the right spot in the help files so I can do some more reading and digging
Thanks ever so much...
buladbanaw
no worries at all. :-) It does get tricky as you are discovering
question I have is...which "call" or "function" are you trying to look for Are these just a list of API's that Kernel32/User32 exposes