Need to pull a date from a web site.
-
Very much a beginner C# person. I need something simple and I'm pretty sure it can be done. I need to go to a website and simply see if a date has changed. I it has I need to pull the date back in. The date always follows the same three words so it will be easy to find. Thanks for any who can help dflat4now
-
Very much a beginner C# person. I need something simple and I'm pretty sure it can be done. I need to go to a website and simply see if a date has changed. I it has I need to pull the date back in. The date always follows the same three words so it will be easy to find. Thanks for any who can help dflat4now
Not sure I fully understand this, but it sounds like you're talking about a specific web page, and you know roughly where to find this date on the specific page. That should be easy enough--just download the content to a string via http, then "find" the date in the string (i.e. by locating the "same three words"), trim the rest away so you just have the date text, then parse this into a DateTime object using either DateTime.Parse, or another (third party) date-parsing algorithm (there are some on CodeProject) depending on the format of the date.
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
-
Very much a beginner C# person. I need something simple and I'm pretty sure it can be done. I need to go to a website and simply see if a date has changed. I it has I need to pull the date back in. The date always follows the same three words so it will be easy to find. Thanks for any who can help dflat4now
Use
WebClient
class to download the webpage content. Write a regular expresssion which finds the required date.All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
Very much a beginner C# person. I need something simple and I'm pretty sure it can be done. I need to go to a website and simply see if a date has changed. I it has I need to pull the date back in. The date always follows the same three words so it will be easy to find. Thanks for any who can help dflat4now