473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

IProvisioningProfileWireless

I posted this in microsoft.public.windows.networking.wireless, but
didn't get any responses. There are a lot more people here, so I'll
try again.

I'm trying to write a small C# app that will take an XML WPS schema
and adds it to any/all wireless interfaces on the system. I'm doing
this by looping through NetworkInterface.GetAllNetworkInterfaces(),
and plugging each guid in turn into a CreateProfile() call. Using the
example WPA schema, I'm getting a status code 33 along with a 'could
not be found . (Exception from HRESULT: 0x80030002
(STG_E_FILENOTFOUND))' exception, and I don't really have any idea
what's causing it.

Any input would be appreciated it. The relevent portion of code is
below.

public uint ImportProfile( string fileName ) {
StreamReader xmlFile = File.OpenText( fileName );
string xml;
uint status = 0;
xml = xmlFile.ReadToEnd( );
IProvisioningProfileWireless ippw = new
NetProvisioningClass( );
foreach ( NetworkInterface netInt in
NetworkInterface.GetAllNetworkInterfaces( ) ) {
System.Guid guid = new Guid( netInt.Id );
try {
ippw.CreateProfile( xml.ToString( ), null, ref
guid, out status );
} catch ( Exception x ) {
throw (new Exception( "Error Code " +
status.ToString( ) + "\n" + x.Message, x ));
}
}
return status;
}

Sep 10 '07 #1
0 958

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.