前言
今天在网上看见了一行简单的代码,就激发了自己的妙想,本次的文章,代码可能是有一点的简单,本次就利用几行代码,把这篇文章给搞起气氛出来。
(1)winfin界面
(2)代码案例
using System;
using System.Windows.Forms;
namespace Phone
{
public partial class Dategrivd : Form
{
public Dategrivd()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
string url = null;//网址路径
url = txtValue.Text.ToString();//网址路径等于文本中的输入内容
System.Diagnostics.Process.Start(url);//根据给定的网址进入到相应的地方
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);//异常提示
}
}
}
}
(