asp.net 中获取中文首字母的代码 亲测
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text.RegularExpressions;
using System.Text;
public partial class baikeWeb_test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
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).ToUpper());
}
//可以返回所有的中文字符的首字母
//return myStr;
return getSpell(strText.Substring(0, 1)).ToUpper();
}
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];
&nbs
相关文档:
http://files.cnblogs.com/chengulv/SoftRegion.rar
Microsoft .Net的应用程序的代码文件,与Java生成的文件类似,它们都没有本地代码,而是一种类似于汇编的代码。这样,只要有合适的工具,就可以完整的把别人写出来的程序反编译成自己需要的程序文件。
我所知道的.Net下的反汇编程序是Salamander 和 Refelector 两个工 ......
在Asp.Net中写了一个附件上传和下载的程序,附件上传到数据库中,然后将附件的GUID保存起来,我们可以根据GUID来找到数据库中的附件,一般附件下载的代码是:
private void Download(string ID)
{
file = logic.GetA ......
在ASP.NET2.0中,为我们提供了两种新功能,方便我们制作共同特征一致的页面和导航。这两种功能是母板页和网站导航。对于母板页大家很清楚了,不过在做母板页时,经常需要添加导航栏,对于此asp.net 2.0 使我们的工作大为简化。这便是站点地图的使用。
顾名思义,站点地图就是在站点 ......
关于&、双引号、和单引号的解释
下面先简单地说一下他们的意义。
(1)&是连接运算符,它可以将两个字符串连接成一个字符串。如
a="abc" & "def"
执行连接运算后,a="abcdef ......
了解使用 ASP.NET AJAX 进行局部页面更新
简介
Microsoft的 ASP.NET 技术提供了一个面向对象、事件驱动的编程模型,并将其与已编译代码的优势结合起来。但其服务器端的处理模型仍存在技术本身所固有的几点不足:
进行页面更新需要往返服务器,因此需要页面刷新;
来回往返不会保留 Javascript 或其他客户端技术(如 Ad ......