ASP.NET获取中文首字母
//ASP.NET获取中文首字母
public class Converter
{
static public string GetChineseSpell(string strText)
{
int len = strText.Length;
string myStr = "";
for (int i = 0; i < len; i++)
{
myStr += getSpell(strText.Substring(i, 1));
}
return myStr;
}
static public string getSpell(string cnChar)
{
byte[] arrCN = Encoding.Default.GetBytes(cnChar);
if (arrCN.Length > 1)
{
int area = (short)arrCN[0];
int pos = (short)arrCN[1];
int code = (area << 8) + pos;
int[] areacode = { 45217, 45253, 45761, 46318, 46826, 47010, 47297, 47614, 48119, 48119, 49062, 49324, 49896, 50371, 50614, 50622, 50906, 51387, 51446, 52218, 52698, 52698, 52698, 52980, 53689, 54481 };
for (int i = 0; i < 26; i++)
&
相关文档:
ASP.NET下载——word,txt,图片方法
本文主要介绍ASP.NET下载诸如word,txt,图片等的方法。
try
{
FullFileName = Server.MapPath(FileName); //FileName--要下载的文件名
FileInfo DownloadFile= new FileInfo(FullFileName);
if(Down ......
在你的Page_Load中添加这样的代码:
Page.Response.Clear();
bool success = ResponseFile(Page.Request, Page.Response, "目的文件名称", @"源文件路径", 1024000);
if (!success)
Response.Write("下载文件出错!");
Page. ......
在ASP.NET的SOUCE中,不会存在BGSOUND这个标签,但是,如果我想插入一段背景音乐怎么办?
我这里有两种解决方法:
1、写入一个网页播放器,但是这样,本人认为很复杂,而且,我也不会
2、用IFRAME嵌套一个HTML网页,将IFRAME的的WIDTH和HEIGHT都设置成0PX,即可。 ......
使用asp.net 开发wap 网站,在ishtml32下,如果手机浏览器支持ishtml32,但是 SupportsCss=False 时,想加载css文件时,采用重写mobile:form的方法来实现
using System;
using System.Configuration;
using System.Web.UI.MobileControls;
using System.Web.UI.MobileControls.Adapters;
public class MyForm : Form
{ ......