Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Wireless Networking > IProvisioningProfileWireless (C#)

Reply
Thread Tools

IProvisioningProfileWireless (C#)

 
 
pdbogen@gmail.com
Guest
Posts: n/a
 
      09-04-2007
I'm trying to write a small C# app that will take an XML WPS schema
and add 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;
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IProvisioningProfileWireless CreateProfile =?Utf-8?B?UGV0ZQ==?= Wireless Networking 0 02-01-2006 02:51 PM
iProvisioningProfileWireless sample code? Barbara Nelson Wireless Networking 0 08-10-2005 09:51 PM



Advertisments