RasSetEntryProperties sample

  • Thread starter Thread starter Catalin Lungu
  • Start date Start date
C

Catalin Lungu

Hi all,
Someone has a sample application that how to use RasSetEntryProperties
function in C#, with RasEntry struct?

Ceers,
Catalin
 
I'm passing RasEntry as an array of bytes and using the field offsets to
fill the values. The part of sample RasEntry and declaration for
RasSetEntryProperties. This method works well for CF1.0+.

public class RASENTRY
{
public RASENTRY()
{
this.data = new byte[3276];
this.dwSize = 3276;
}

public byte[] Data
{
get
{
return this.data;
}
}

public int dwSize
{
get
{
return BitConverter.ToInt32(this.data, 0);
}
set
{
BitConverter.GetBytes(value).CopyTo(this.data, 0);
}
}

...

private byte[] data;
private const int dwCountryCodeOff = 12;
private const int dwCountryIDOff = 8;
private const int dwOptionsOff = 4;
private const int dwSizeOff = 0;
}



[DllImport("coredll")]
internal static extern int RasSetEntryProperties(string lpszPhoneBook,
string szEntry, byte[] lpbEntry, int dwEntrySize, byte[] lpb, int dwSize);

HTH,
S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top