如何使用C#在HTML中获取新行 [英] How to get new line in HTML using C#

查看:84
本文介绍了如何使用C#在HTML中获取新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我准备一个Windows窗体工具,当我点击按钮它必须生成与我的Windows窗体相同的HTML文档时,一切都很好,但问题是当我给我的文本框提供多行文本输入时,它正在给出继续文本,可以使用c#来帮助获取html中的新行文本。



我尝试过:



sb.AppendFormat({0}

+ textBox3.Text +

);

和我也试过

sb.AppendFormat({0}
,textBox3.Text +
);

解决方案

在HTML中,文本行被任何块元素(例如 div p )或通过< br />



此外,文本流中任何元素的行为都可以通过元素样式(CSS属性)更改其属性 display 进行更改: display - CSS



-SA

i preparing a Windows form Utility,when i clicked on button it has to generate HTML document same as my Windows form, every thing is fine ,but the problem is when i am giving multi line text input to my text box ,it is giving as Continues Text,can any please help to get new line text in html using c#.

What I have tried:

sb.AppendFormat("{0}
","

"+textBox3.Text+"

");
and i also tried
sb.AppendFormat("{0}
",textBox3.Text+"
");

解决方案

In HTML, lines of text are broken by any block elements (such as div or p) or by <br/>.

Besides, the behavior of any element in the stream of text can be altered by changing its property display via the element style (CSS property): display — CSS.

—SA


这篇关于如何使用C#在HTML中获取新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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