GUID

  • Thread starter Thread starter tim.boon
  • Start date Start date
T

tim.boon

Below is some C# code that I am using to try and access the network
adapter GUID in the registry:

string
key = @"SOFTWARE\Microsoft\WZCSVC\Parameters\Interfaces\" +
this.adapterGuid.ToString("B");

However, I am getting the following error message: "Does not contain a
definition for the adapterGuid ". Is this because I need to specify a
specific class to be able to use "this.adapterGuid"?

Thanks,
 
However, I am getting the following error message: "Does not contain a
definition for the adapterGuid ". Is this because I need to specify a
specific class to be able to use "this.adapterGuid"?

No you need to declare a field (or property) of type Guid with the
name adapterGuid in your class. Apparently you haven't done so.


Mattias
 
Sorry I am not a c# programmer, could you tell me the code that I need
to use to do this? As when I use:

public string adapterGuid;

I am getting the following error message:

"cannot convert from 'string' to 'System.IFormatProvider'
 
Sorry I am not a c# programmer,

You're writing C# code, aren't you? :)

could you tell me the code that I need
to use to do this? As when I use:

public string adapterGuid;

private Guid adapterGuid;

Keep it private unless you have a good reason to make it more
accessible.

I am getting the following error message:

"cannot convert from 'string' to 'System.IFormatProvider'

I don't see how the code you originally posted could possibly give
that error. You must have left something out.


Mattias
 
I have now added the following variable declaration: private Guid
adapterGuid;

However ' this.adapterGuid ' is now returning a null value: '
{00000000-0000-0000-0000-000000000000} '. Any ideas why this is
happening?

Thanks,
 
Back
Top