如何添加在C#文本框HTML链接? [英] How do I add HTML links in C# TextBox?

查看:270
本文介绍了如何添加在C#文本框HTML链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能把一个链接在C#文本框?我试图把HTML标签的盒子,而是呈现一个链接它显示了完整的HTML标记。可以这样用文本框

How can I put a link in a C# TextBox? I have tried to put HTML tags in the box but instead of showing a link it shows the entire HTML tag. Can this be done with a TextBox?

推荐答案

我会考虑这个一点点。如果允许在一个可编辑的控制可执行代码,用户,用户可以执行的任何代码。这通常是一个坏主意。

I would think about this a little bit. If you allow executable code in an editable control, the user, the user can execute ANY code. This is generally a bad idea.

在C#控制行为是故意的,以防止您要创建的确切行为。小创意(如文本框解析出联系,并创造下一个或下面的文本框中的链接列表)将提供一个更安全的应用程序。

The behavior of the C# control is intentional to prevent the exact behavior that you are trying to create. A little creativity (such as parsing out links from the text box and creating a list of links next or below the text box) will provide a much safer application.

这篇关于如何添加在C#文本框HTML链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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