Public Function BaglantiKontrol() As Boolean
Dim yol As New System.Uri("https://www.google.com/ ")
' RazorCral-EmirAYildiz
Dim istek As System.Net.WebRequest
istek = System.Net.WebRequest.Create(yol)
Dim Cevap As System.Net.WebResponse
Try
Cevap = istek.GetResponse
Cevap.Close()
istek = Nothing
Return True
Catch ex As Exception
istek = Nothing
Return False
End Try
End Function
private void Form1_KeyDown(object sender, KeyEventArgs e)//Event ile oluşturduk
{
//picturebox'a x ve y koordinatları atıyoruz.
int x = pictureBox1.Location.X;
int y = pictureBox1.Location.Y;
if (e.KeyCode == Keys.Right && x0)
x -= 5;//Tuşa 1 kere basıldığında kaç pixel kayacağını gösteriyor
else if (e.KeyCode == Keys.Up && y>0)
y -= 5;
else if (e.KeyCode == Keys.Down && y<410)
y += 5;
pictureBox1.Location = new Point(x, y);
if (x < 100 && y < 100)// Nesne sol üste gidince işlem yapılsın diye.
{
MessageBox.Show("Tebriklern"
pictureBox1.Location = new Point(250, 250);//Sol üste gidince tekrar başlıyacağı yer.
}
}