Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 NewTools
- {
- public partial class frmBrowser : Form
- {
- public frmBrowser()
- {
- InitializeComponent();
- }
- private void btnSearch_Click(object sender, EventArgs e)
- {
- string sAddress = txtAddress.Text;
- string sHeader = sAddress.Substring(0, 4);
- Uri uri = new Uri(sAddress, UriKind.RelativeOrAbsolute);
- if (!uri.IsAbsoluteUri)
- {
- if(sHeader == "www.")
- {
- sAddress = "https://" + sAddress;
- }
- else
- {
- sAddress = "https://www." + sAddress;
- }
- Uri uri2 = new Uri(sAddress, UriKind.RelativeOrAbsolute);
- brsHomepage.Navigate (uri2);
- }
- else
- {
- brsHomepage.Navigate(uri);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement