Commented C# Code Needed For Project (Involves Code to Log into site)
$30-250 USD
Completed
Posted over 11 years ago
$30-250 USD
Paid on delivery
I currently am a novice programmer and have several projects for personal use....
I need 2 sets of code to be written and clearly commented for every 'function' so I can learn from it as this is of equal importance as the code function itself!!
Ideally, I would like both in a class with instructions on how to implement them in my other projects as I have little experience with classes although I do understand what they are.
Part 1. (Possibly a good idea would be a 'RacingPost' class with inputs (string username, string password, string url)
I need to programmatically log into the site: [login to view URL] and then scrape the text (ideally raw source) from a protected area which requires aforementioned log in. (I am also very keen to understand how cookies can be retrieved and then used)
Part 2.
I need to programmatically log into [login to view URL];cb=10881429189
I then need to have a function to open a url from the same site in a webBrowser object (this url is an instant bet slip which requires the cookie or authentication from the log in)
Currently, I can open the first url in a webBrowser object and if I use [login to view URL](url) it loses the log in BUT if I use [login to view URL](url, true) the new window (default browser not project form or wb objects) works fine and shows me as logged in but I MUST have the new url in a WebBrowser object on my project form.
Note!! The url changes daily and is pre-scraped by code I have already written but I can easily give instructions as to where & how to get the url for any day/event,
An example of this url : [login to view URL];affiliatecode=odc10&odds=5/2&instantbet=1
It is also important that I would need to change via string variable, the value of ' &affiliatecode=odc10 ' or to be precise, the bit saying 'odc10'
On this new url, there is a button (only shows when logged in) saying 'Bet Max' - I need to programmatically 'click' this and a figure will appear in both the 'Stake' box and 'To Win' box - I would then need the program to : Save the 'To Win' and 'Stake' values to variables and then clear both fields.....
Next I need the code to enter any two variables into those boxes - the idea being 'check max allowable' compare to default variables, if default amounts were more then use the values taken from the betslip or if less, use the default values... OR just change one box's value and leave the other (they auto-update just noticed) - lastly, I would need code to programatically 'click' the 'Place Bet' button
It is worth noting that there can be more than one Stake and To Win fields as the slip could contain more horses...if this is the case, then I would (after checking if it is the case or not) want an array(or similar ?list?) with 3 fields: Name,Stake,ToWin
As I said in the beginning, I would want to learn from this and be able to repeat for different sites using similar methods - I would want everything commented extensively either in the code via comments & regions OR in a word document using screenshots or ref to line numbers...
The screenshots show most of it but when arranging job, I can supply urls etc and temp passes
Thanks,
Paul