This is another update on how to connect to a web page using Visual Studio C#.
It's a very simple Windows form application using a few lines of code.
Here's what you need to do:
- Start new project in Visual Studio
- Select Windows Form Application
- Rename as Web Form Page
Next drag and drop a form, 3 labels, and 3 buttons just like use see in my project
Then in the main code screen type in source code
I added the logos to make it look more awesome. Have fun!
Source code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WinWebForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://www.google.com");
}
private void button3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://www.bing.com/");
}
private void button2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("www.youtube.com");
}
}
}
No comments:
Post a Comment