Si la autenticacion la estas haciendo contra alguna pagina, pues es lo correcto. De todas maneras creo que es mejor idea que la autenticacion la manejes como un webservice. En el MSDN tienes un ejemplo pero igual te lo dejo aqui
// Create a new webrequest to the mentioned URL.
WebRequest myWebRequest=WebRequest.Create(url);
// Set 'Preauthenticate' property to true. Credentials will be sent with the request.
myWebRequest.PreAuthenticate=true;
Console.WriteLine("\nPlease Enter ur credentials for the requested Url");
Console.WriteLine("UserName");
string UserName=Console.ReadLine();
Console.WriteLine("Password");
string Password=Console.ReadLine();
// Create a New 'NetworkCredential' object.
NetworkCredential networkCredential=new NetworkCredential(UserName,Password);
// Associate the 'NetworkCredential' object with the 'WebRequest' object.
myWebRequest.Credentials=networkCredential;
// Assign the response object of 'WebRequest' to a 'WebResponse' variable.
WebResponse myWebResponse=myWebRequest.GetResponse();
[C++]