string url = "https://www.baidu.com/";
Uri u = new Uri(url);
//MessageBox.Show(u.GetType().GetProperties()[0].ToString());
foreach (System.Reflection.PropertyInfo p in u.GetType().GetProperties())
{
textBox1.Text += p.Name + ":" + p.GetValue(u, null) + "\r\n";
}
时间: 2024-10-09 17:12:09