How to make HTTP request in windows service?

10,632

The following 3 MSDN pages should get you started.

  1. Make HTTP Request: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx
  2. Working with timers: http://msdn.microsoft.com/en-us/library/system.timers.timer(v=VS.100).aspx
  3. Emailing: http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx
Share:
10,632
r.r
Author by

r.r

Updated on June 04, 2022

Comments

  • r.r
    r.r almost 2 years

    i want to implement my first windows service application. this app must run day and night. it should to send each 1 hour http request with possibility to make snapshot of requested webpage and save it in database.

    can you show me some c# code examples how to:

    1. make http request from windows service.
    2. set a timer for requesting each 1 hour.
    3. send e-mail that snapshot is successfully saved in DB.

    thank you!

  • Jordan
    Jordan over 13 years
    Glad to help! If you haven't installed the MSDN locally, it can be a big help when looking up names of classes or things you want to do. Or, you could set up a search shortcut in your browser for just the MSDN.
  • PawanS
    PawanS over 13 years
    Helps you to learn about screen shot. Create a Win Service and send the URL along with your request to whom you want to take the back up.. dreamincode.net/forums/topic/34831-taking-a-screen-shot-in-c‌​%23