我正在尝试打印包含HTML的变量。我的问题是html是动态的...例如...
public MainPage()
{
InitializeComponent();
label.Text=await Task.Run(TaskTest); //this doesn't work
}
private async Task<string> TaskTest()
{
try
{
using (WebClient client = new WebClient())
{
return await client.DownloadStringTaskAsync("https://www.example.com/return.php");
//also tried w/ no success:
//return client.DownloadStringTaskAsync("https://www.example.com/return.php").Result;
}
}
catch (Exception)
{
throw;
}
}
因此,如果我想在文本底部添加一些内容...我需要知道它键入的最后位置或此块的高度...
有什么方法可以知道此块的总高度是多少?或....最后键入的坐标是什么?...或行数...?
我正在像这样打印此变量...
// the number of <p> is dinamic... this value comes from a text editor..
//so the number of <p> can change...
var text: "<div><p>Line 1</p><p> Line 2</p></div>"