在 C# 中,我可能会这样做:
System.Net.WebClient w = new System.Net.WebClient();
w.Credentials = new System.Net.NetworkCredential(username, auth, domain);
string webpage = w.DownloadString(url);
是否有 Powershell 版本,或者我应该直接致电CLR https://stackoverflow.com/questions/340553/what-is-the-best-way-to-send-http-requests-from-windows-powershell?
PowerShell 几乎完全相同。
$webclient = new-object System.Net.WebClient
$webclient.Credentials = new-object System.Net.NetworkCredential($username, $password, $domain)
$webpage = $webclient.DownloadString($url)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)