zoukankan
html css js c++ java
获取word文档或rtf格式文档的格式编码(可以应用此格式将字符以数据流的方式写入word或rtf文档)
/**/
///
<summary>
///
生成中文字符编码
///
</summary>
///
<param name="ChinaStr"></param>
///
<returns></returns>
private
string
GetCode(
string
ChinaStr)
{
string
str1
=
""
;
System.Windows.Forms.RichTextBox myRich1
=
new
RichTextBox();
myRich1.Text
=
ChinaStr;
myRich1.SelectAll();
ChinaStr
=
myRich1.SelectedRtf;
int
count1
=
ChinaStr.Length ;
int
start1
=
ChinaStr.IndexOf(
"
fs18
"
,
0
,count1);
if
(start1
==-
1
)
return
str1;
str1
=
ChinaStr.Substring(start1
+
4
,count1
-
start1
-
4
);
string
str3
=
@"
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fcharset0 Arial;}{\f1\fnil\fcharset134 \'cb\'ce\'cc\'e5;}}
\viewkind4\uc1\pard\lang2052\fs18\f1
"
;
str1
=
str3
+
str1;
return
str1;
}
private
string
GetCode(
string
ChinaStr,System.Drawing.Font newFont )
{
string
str1
=
""
;
System.Windows.Forms.RichTextBox myRich1
=
new
RichTextBox();
myRich1.Font
=
newFont;
myRich1.Text
=
ChinaStr;
myRich1.SelectAll() ;
ChinaStr
=
myRich1.SelectedRtf;
int
count1
=
ChinaStr.Length ;
int
start1
=
ChinaStr.IndexOf(
@"
\fs
"
,
0
,count1);
if
(start1
==-
1
)
{
return
str1;
}
ChinaStr
=
ChinaStr.Insert(start1
+
5
,
@"
\f1
"
);
str1
=
ChinaStr ;
return
str1;
}
查看全文
相关阅读:
asp中动态include的方法
asp存储过程使用大全
用vb6写asp组件的简单例子
asp中遍历一些对象(request,session,Application)
查看ASP Session 变量的小工具
层不能跨框架(包括TEXTAREA)显示的解决办法
保存远程图片到本地 同时取得第一张图片并创建缩略图
使用.Net开发asp组件
使用ASP在IIS创建WEB站点
解析notes自带的rtf javaapplet编辑器
原文地址:https://www.cnblogs.com/furenjun/p/326521.html
最新文章
OpenLayers应用一(转自http://www.cnblogs.com/lzlynn/)
Flex XML转ArrayCollection的问题
Geoserver项目开发(一) 不同比例次
iOS程序发布测试之获取Tester设备UDID
APP開發]免年繳$99開發帳號將Xcode發佈到iPhone裝置上
google地图经纬度偏移修正算法完美解决方案
openlayer9 http://hi.baidu.com/perneter/blog/item/194f1399ba4135056e068cde.html
javascript无提示关闭窗口,兼容IE,Firefox
openlayer+udig+geowebcache+
远程服务器连接时要记得设置,不然无法复制本机文件到服务器
热门文章
Firebug
C# 之linq前奏
linq基本操作
xp sp3+iis 服务器不可用
url中& 符号后面的参数被截取的解决办法
mvc3的使用(一)
vs2010 安装mvc3
EntityFramework 连接数据库出错
EFCodeFirst系列
Vml图像画板
Copyright © 2011-2022 走看看