这是我到目前为止所拥有的。相当新的我自己。非常感谢帮助。我的目标是将信息保存到几乎在任何地方创建的文本文件中,但最好是在临时文件夹或其他内容。
static async void GetNewData()
{
String page = "http://www.coinmarketcap.com";
var client = new HttpClient();
// Create the HttpContent for the form to be posted.
var requestContent = new FormUrlEncodedContent(new[] {
new KeyValuePair<string, string>("text", "This is a block of text"),
});
// Get the response.
HttpResponseMessage response = await client.PostAsync(page,
requestContent);
// Get the response content.
HttpContent responseContent = response.Content;
// Get the stream of the content.
using (var reader = new StreamReader(await responseContent.ReadAsStreamAsync()))
{
// Write the output.
Console.WriteLine(await reader.ReadToEndAsync());
using (StreamWriter w = File.AppendText(reader.ReadToEndAsync().ToString);
// StreamWriter sw1 = new StreamWriter(File.OpenWrite());
// sw1.Write(await reader.ReadToEndAsync() textytext);
}
}
}
}
再一次,任何建议都会非常有帮助,我一定会提出最准确的答案:)