这里采用PowerShell编写脚本请求3322的动态域名接口
$pair = "root:更新密码" $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) $basicAuthValue = "Basic $encodedCreds" $Headers = @{Authorization = $basicAuthValue} Invoke-WebRequest -Headers $Headers -Uri 'http://www.3322.org/dyndns/update?system=dyndns&hostname=oymd.f3322.net'
通过以上脚本即可更新你的动态域名了
下面写成一条命令更新动态IP
Invoke-WebRequest -Headers @{Authorization = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("root:密码"))} -Uri 'http://www.3322.org/dyndns/update?system=dyndns&hostname=oymd.f3322.net'
上面这个只能在Powershell里执行
下面的可以在cmd中执行
PowerShell -Command "(Invoke-WebRequest -Headers @{Authorization = 'Basic '+[System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes('root:密码'))} -Uri 'http://www.3322.org/dyndns/update?system=dyndns&hostname=oymd.f3322.net').Content"
标签:www.3322,windows,System,Headers,dyndns,动态域名,ASCII,DDNS From: https://www.cnblogs.com/xiangxisheng/p/16837853.html