HttpWebRequest doesn't have a GetRequestStream or GetRequestStreamAsync in WP8. Your best bet is to create a Task and await on it, like so:
using (var stream = await Task.Factory.FromAsync<Stream>(request.BeginGetRequestStream, request.EndGetRequestStream, null))
{
// ...
}
Edit: as you've mentioned that you're new to C#, you would need to have your login method be async to use the await keyword:
public async Task<string> LoginAsync()
{
// ...
}
Callers to login would need to use the await keyword when calling:
string result = await foo.LoginAsync();
Here's a good primer on the subject: http://msdn.microsoft.com/en-us/library/vstudio/hh191443.aspx
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…