当尝试使用以下代码连接到Linux服务器时,vb.net中的Web应用程序正在返回
远程服务器返回错误:(401)未经授权
错误。
码:
oWebRequest = WebRequest.Create(sWebSSHUrl) oWebRequest.Method = "POST" oWebRequest.ContentLength = sFormData.Length oWebRequest.ContentType = "application/x-www-form-urlencoded" oWebRequest.Timeout = i_lTimeout * 1000 oRequestStream = oWebRequest.GetRequestStream() 'send the request oStreamWriter = New StreamWriter(oRequestStream) oStreamWriter.Write(sFormData)
我已经search了networking,并尝试进行更改,包括将身份更改为本地系统,启用匿名身份validation,在代码中添加默认凭据,但目前为止没有任何工作。