Browser Application Version 1.0.0 developed by me.. This application will run on any operating system like windows 7, 8, 8.1 and Xp also.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
namespace Control1
{
public partial class Browser : Form
{
public Browser()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
try
{
if (textBox1.Text.Contains("www.") || textBox1.Text.Contains(".in"))
{
string target = textBox1.Text;
System.Diagnostics.Process.Start(target);// to open a link at default browser
}
else
{
MessageBox.Show("Type Correct URI Link");
}
}
catch (FormatException e1)
{
MessageBox.Show(e1.Message);
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
ProcessStartInfo sInfo = new ProcessStartInfo(e.Link.LinkData.ToString());
Process.Start(sInfo);
}
private void Form1_Load(object sender, EventArgs e)
{
linkLabel1.Links.Remove(linkLabel1.Links[0]);
linkLabel1.Links.Add(0, linkLabel1.Text.Length, "https://www.google.co.in");
}
private void button2_Click(object sender, EventArgs e)
{
try
{
string target1 = textBox2.Text;
System.Diagnostics.Process.Start("IExplore.exe", target1);// to open a link at default browser
}
catch (FormatException e1)
{
MessageBox.Show(e1.Message);
}
}
private void button3_Click(object sender, EventArgs e)
{
webBrowser1.Url = new System.Uri(textBox3.Text, System.UriKind.RelativeOrAbsolute);
}
}
}
No comments:
Post a Comment