Hello,
I havn't program C# for a while, but now i am starting up again.
This code does work trough the compiler, but in real world it doesn't work, what's the problem?
Code:
#region using
using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.Net;
#endregion
public class MainsClass
{
public static void Main()
{
new InterfaceClass();
}
}
public class InterfaceClass
{
public InterfaceClass()
{
Form MainWindow = new Form();
PictureBox MainBox = new PictureBox();
MainWindow.Text = "Startup Screen";
MainWindow.StartPosition = FormStartPosition.CenterScreen;
MainWindow.Width = 640;
MainWindow.Height = 480;
WebRequest reg = WebRequest.Create("http://raceoffice.segel.aland.fi:81/record/current.jpg");
Stream stream = reg.GetResponse().GetResponseStream();
Bitmap img = new Bitmap(stream);
MainBox.BackgroundImage = img;
MainBox.Width = 600;
MainBox.Height = 450;
MainBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
MainBox.Visible = true;
MainWindow.ShowDialog();
}
}
Sorry about my bad english, i'm from finland (europe).
Thanks,
/Linus