玉树林风

导航

2011年10月24日 #

C#中的换行

摘要: winform 中 TextBox 的 Multiline属性设置为 true ,敲入几个字符和几个回车,然后保存到数据库,再从数据库中读取出来赋值给TextBox,换行符丢失。将读取出的字符串中的"\n"替换为"\r\n"解决问题。1、TextBox 中换行符为: "\r\n"。2、Windows 中的换行符(即:Environment.NewLine) 为 "\r\n"3、MessageBox.Show() 的换行符为 "\n"4、Console 的换行符为 "\n" 阅读全文

posted @ 2011-10-24 09:22 yuanyulin 阅读(581) 评论(0) 推荐(0)

将系统时间格式 修改成 "yyyy/MM/dd HH:mm:ss"

摘要: 将系统时间格式 修改成 "yyyy/MM/dd HH:mm:ss"using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace WindowsFormsApplication1{ public partial class svcho 阅读全文

posted @ 2011-10-24 08:28 yuanyulin 阅读(1743) 评论(0) 推荐(0)