c#.net加载变量网页 [英] c#.net loading variable webpages

查看:64
本文介绍了c#.net加载变量网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要根据链接标签文本加载网站。

我目前正在使用以下代码:



I want, to load a website based on a link label text.
I am currently using the following code to do so:

LinkLabel input = (LinkLabel)sender;
        Process.Start("http://{0}",input.Text.ToString());







但是当我点击链接时,它只是指示我:< br $> b $ b

http://%7B0%7D /这不是我想要的!



任何帮助表示赞赏!



Dan




However when I click on a link, it just directs me to:

http://%7B0%7D/ which is not what I want it to do!

Any help is appreciated!

Dan

推荐答案





看起来你的字符串没有正确连接。



尝试通过string.concat()构建字符串:



Hi,

It looks like your string in not getting joined properly.

Try building the string via string.concat():

Process.Start(string.concat("http://",input.Text.ToString()));







希望有所帮助。




Hope it helps.


使用以下代码



Use Below Code

private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LinkLabel input = (LinkLabel)sender;
            Process.Start("http://"+input.Text);
        }


这篇关于c#.net加载变量网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆