开发者

Windows 7: Automatic Logon Policy not working for winhttp API VB6 activeX control

开发者 https://www.devze.com 2022-12-13 00:19 出处:网络
I\'m using WinHttp to do POSTs in a VB6 activeX control as follows Set WinHttpRe开发者_开发问答q = New WinHttpRequest

I'm using WinHttp to do POSTs in a VB6 activeX control as follows

Set WinHttpRe开发者_开发问答q = New WinHttpRequest
WinHttpReq.Open "POST", strUrl, False
WinHttpReq.SetAutoLogonPolicy AutoLogonPolicy_Always
aPostBody = 'Sometext'
WinHttpReq.Send aPostBody
UploadFile = WinHttpReq.ResponseText

This works great on windows XP (all versions of IE), but on windows 7 it sends back a 401 and Automatic Logon Policy doesn't work here (http://msdn.microsoft.com/en-us/library/aa383144(VS.85).aspx)


After trying some more on the VB6 activeX control, I implemented the control in C# using

Code Project : Downloading C# ActiveX Components through CAB File

Works like a charm, no more authentication issues rather now I can do so much more since it's good old C#.

0

精彩评论

暂无评论...
验证码 换一张
取 消