Windows 7: Automatic Logon Policy not working for winhttp API VB6 activeX control
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#.
精彩评论