Skip to content

Instantly share code, notes, and snippets.

View davlgd's full-sized avatar

David Legrand davlgd

View GitHub Profile
@davlgd
davlgd / Form1.cs
Last active December 22, 2017 16:11
AlticeStockChecker - Etape 1
public Form1()
{
InitializeComponent();
this.Text = Application.ProductName;
}
@davlgd
davlgd / Form1.cs
Last active December 22, 2017 09:04
AlticeStockChecker - Etape 2
public Form1()
{
InitializeComponent();
this.Text = Application.ProductName;
WebClient wc = new WebClient();
string webPageCode = wc.DownloadString("https://finance.yahoo.com/quote/ATC.AS?p=ATC.AS");
}
@davlgd
davlgd / Form1.cs
Last active December 22, 2017 16:17
AlticeStockChecker - Etape 3
public Form1()
{
InitializeComponent();
this.Text = Application.ProductName;
using (WebClient wc = new WebClient())
{
string webPageCode = wc.DownloadString("https://finance.yahoo.com/quote/ATC.AS?p=ATC.AS");
}
}
@davlgd
davlgd / Form1.cs
Last active December 22, 2017 09:22
AlticeStockChecker - Etape 4
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace AlticeStockChecker
{
public partial class Form1 : Form
{
public Form1()
{
@davlgd
davlgd / Form1.cs
Created December 22, 2017 09:41
AlticeStockChecker - Etape 5
public Form1()
{
InitializeComponent();
this.Text = Application.ProductName;
string webPageCode = string.Empty;
using (WebClient wc = new WebClient())
{
webPageCode = wc.DownloadString("https://finance.yahoo.com/quote/ATC.AS?p=ATC.AS");
@davlgd
davlgd / Form1.cs
Created December 22, 2017 09:59
AlticeStockChecker - Etape 6
public Form1()
{
InitializeComponent();
this.Text = Application.ProductName;
}
private void timer1_Tick(object sender, System.EventArgs e)
{
string webPageCode = string.Empty;
@davlgd
davlgd / Form1.cs
Created December 22, 2017 11:14
AlticeStockChecker - Etape 7
public Form1()
{
InitializeComponent();
this.Text = Application.ProductName;
GetAndCleanStockValue();
}
private void timer1_Tick(object sender, System.EventArgs e)
{
GetAndCleanStockValue();
@davlgd
davlgd / Form1.cs
Created December 22, 2017 11:41
AlticeStockChecker - Etape 8
using System.Globalization;
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace AlticeStockChecker
{
public partial class Form1 : Form
{
public Form1()
@davlgd
davlgd / Form1.cs
Created December 22, 2017 12:03
AlticeStockChecker - Etape 9
if (stock > lastStock && lastStock != 0.0)
{
lblStock.ForeColor = Color.Green;
}
else if (stock < lastStock && lastStock != 0.0)
{
lblStock.ForeColor = Color.Red;
}
else
{
@davlgd
davlgd / Form1.cs
Created December 22, 2017 12:30
AlticeStockChecker - Etape 10
private string GetHTMLCode(string url)
{
string webPageCode = string.Empty;
using (WebClient wc = new WebClient())
{
webPageCode = wc.DownloadString(url);
}
return webPageCode;