Answered by:
InternetSetCookie from a windows service failing - error code 0

Question
-
Hello All,
I am working on a windows service application. This service will refresh a cookie at the specified interval. I am using InternetSetCookie to do the job. This works fine in a console application but the same piece of code not working in a windows service. GetLastError returns 0. I have tried with different logon options for the service, but no positive result.
Please help me on this. Is there any alternative for InternetSetCookie?
Thank you.
silambarasan.P
- Moved by 宝宝徐 Wednesday, January 3, 2018 5:54 AM
Tuesday, January 2, 2018 9:15 AM
Answers
-
I would ask here:
https://social.msdn.microsoft.com/Forums/en-US/home?category=vslanguages
or possibly here:
https://social.msdn.microsoft.com/Forums/en-US/home?forum=netfxbcl
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Proposed as answer by Dave PatrickMVP Wednesday, January 3, 2018 2:01 PM
- Marked as answer by Just Karl Wednesday, January 10, 2018 3:32 PM
Wednesday, January 3, 2018 12:18 PM -
I am working on a windows service application.
or also try asking for help over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Richard MuellerMVP Wednesday, January 3, 2018 2:11 PM
- Marked as answer by Just Karl Wednesday, January 10, 2018 3:32 PM
Wednesday, January 3, 2018 2:02 PM
All replies
-
The documentation for InternetSetCookie clearly states - "Note WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP)."Tuesday, January 2, 2018 2:28 PM
-
Hi silambarasan.P,
Thank you for posting in MSDN forum.
This forum is discussing about VS setup and installation, as your question is much related to windows service application, I help you direct this case to a much appropriate forum to get a professional support.
Thank you for your understanding.
Best Regards,
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Wednesday, January 3, 2018 5:54 AM -
I would ask here:
https://social.msdn.microsoft.com/Forums/en-US/home?category=vslanguages
or possibly here:
https://social.msdn.microsoft.com/Forums/en-US/home?forum=netfxbcl
Richard Mueller - MVP Enterprise Mobility (Identity and Access)
- Proposed as answer by Dave PatrickMVP Wednesday, January 3, 2018 2:01 PM
- Marked as answer by Just Karl Wednesday, January 10, 2018 3:32 PM
Wednesday, January 3, 2018 12:18 PM -
I am working on a windows service application.
or also try asking for help over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.- Proposed as answer by Richard MuellerMVP Wednesday, January 3, 2018 2:11 PM
- Marked as answer by Just Karl Wednesday, January 10, 2018 3:32 PM
Wednesday, January 3, 2018 2:02 PM