今天在查阅 MSDN 文档时发现这个接口, 其实在线状态的接口, Live已经提供了, 但是需要用户自己操作才能获到该地址. 而且是加密的.


http://messenger.services.live.com/users/d67cb5fcd15e35a5@apps.messenger.live.com/presenceimage?mkt=zh-cn

 

现在有以下的接口参数就太方便了. 可在自己定义状态的图片信息等.

http://messenger.services.live.com/users/youliveid@msn.com/presence/?cb=showpresence

{
    "icon": {
        "url": "http://www.wlmessenger.net/static/img/presence/Online.gif", "height": 16, "width": 16
    }, "statusText": "Online", "status": "Online", "displayName": "s.sams", "id": "youliveid@msn.com"
}

再结合 Newtonsoft.Json 完全实现自定义操作.

http://www.codeplex.com/Json

 

Code(该摘自:Json.net/Newtonsoft 3.0 新特性JObject/Linq to Json )
static void Main(string[] args)
{
string str = "{title:123,body:456,list:{title:'这是一个标题',body:'what'}}";
JObject o = JObject.Parse(str);
Console.WriteLine(o[
"title"]);
Console.WriteLine(o[
"body"]);
Console.WriteLine(o[
"list"]["title"]);
Console.WriteLine(o[
"list"]["body"]);
Console.ReadKey();
}

 

更多技术文档请参阅: http://dev.live.com/Messenger/default.aspx

附上MSN在线小图标直接地址: http://messenger.services.live.com/users/youmsnid@msn.com/presenceimage/
Live 在线状态生成地址: http://settings.messenger.live.com/applications/CreateHtml.aspx

补充一下: 其实在 http://www.onlinestatus.org/ 是可以生成在线图标的, 但服务很不稳定.

posted @ 2008-09-19 16:49 S.Sams 阅读(253) | 评论 (1)编辑
BIND 9.5.1b1 is a beta release for BIND 9.5.1

BIND version 9 is a major rewrite of nearly all aspects of the underlying BIND architecture.

BIND 9.5 is the current release of BIND. It is supported, and bug fixes and security fixes will be made available as minor releases (9.5.y).

Some of the important features of BIND 9 are:

  • DNS Security
    • DNSSEC (signed zones)
    • TSIG (signed DNS requests)
  • IP version 6
    • Answers DNS queries on IPv6 sockets
    • IPv6 resource records (AAAA, DNAME, etc.)
    • Experimental IPv6 Resolver Library
  • DNS Protocol Enhancements
    • IXFR, DDNS, Notify, EDNS0
    • Improved standards conformance
  • Views
    • One server process can provide multiple "views" of the DNS namespace, e.g. an "inside" view to certain clients, and an "outside" view to others.
  • Multiprocessor Support
  • Improved Portability Architecture

BIND version 9 development has been underwritten by the following organizations:


[ Downloads ]
[ Notes ]
[ Documentation ]
[ Building BIND ]
[ Release Notes ]
[ Upcoming Fixes ]


DOWNLOADS

</COLS=6>

Package
Download
Signatures

Source
bind-9.5.1b1.tar.gz
asc
sha256
sha512

Windows XP/2003/2008 Binary Kit
BIND9.5.1b1.zip
asc
sha256
sha512

Windows XP/2003/2008 Debug Build Binary Kit
BIND9.5.1b1.debug.zip
asc
sha256
sha512

All ISC software is signed with our OpenPGP Key

You can download ISC software either from our master site, or at a number of mirror sites across the globe.

posted @ 2008-09-12 14:19 S.Sams 阅读(253) | 评论 (2)编辑

您只需要定位经纬度就可以轻易实现 Google Maps, 让您在轻松的C#环境中非常简便地实现基于 javascript 的地图, 您不用去查找 google 大量的地图文档便可轻松完成复杂的地图功能, 当然您同样可以在当前生成的基础上进行扩展, 实现更加个性化的地图!

对 Google Maps API 全面集成!

生成一张地图, 就是这么简单

	Init inits = new Init("showmymap");
List<Label> labels = new List<Label>()
{
new Label(){X = 23.134391,Y = 113.287550}
};
MapScript.Text =  new Maps(AppId, inits, labels).ToString();

下载Demo实例: http://code.google.com/p/donetgooglemapsapi/downloads/list 如果您需要更多的个性化功能, 接着往下看(系统设置项).

2008-08-28 新增

增加多标签 Tab 项支持
Javascript 脚本压缩输出
增加用户自定义标注支持
用户自定义标注点支持消息显示和回调函数自定义 CallBack
改进 google maps 处理流程
标注点 ZoomIn 支持 0 值, 不改当前地图的 ZoomIn 值
增加地图启用鼠标滚轮动作控制 

2008-08-29 新增

增加标注点缩略图预览 Label.IsShowMapView = true 即可!
增加支持将地图输出为图片 

2008-08-30 新增

增加标注点支持消息显示框放大和内容重置
增加支持地图搜索功能
支持地图Javascript引擎地址自定义(可切换到 http://ditu.google.com/)
重写标注点定义 

2008-09-08 更新

修正地图生成图片bug
动态加载 javascript onload / onunload 事件 

源代码SVN: http://donetgooglemapsapi.googlecode.com/svn/trunk/

看下如何实现

    /// <summary>
/// MapPageBase 处理了 // onload="initialize()" onunload="GUnload()" 这两个事件, 如果不使用继承, 请自行处理该事件!
/// </summary>
public partial class Example : MapPageBase
{
protected void Page_Load(object sender, EventArgs e)
{
// 在这里申请你的 AppKey
// http://code.google.com/apis/maps/signup.html
string AppId = "ABQIAAAAT2TW27KPpzTcS3Av9rRZ8xTMc_QNvQYPZO4F6J-ygmVXuqkocRS6gkKMvUKO2am7UGh-wFKm8McGSQ";
//默认初始化
//Init inits = new Init("showmymap",15);
Init inits = new Init("showmymap") { Maptype = MapType.G_PHYSICAL_MAP};
// 定义经纬度坐标点
List<Label> labels = new List<Label>()
{
new Label()
{
X = 23.134391,
Y = 113.287550,
// ------------- 以下是可选项, 可以不设置, 使用系统的默认值 ------------
IsCenter = true,  // 设置中心点, 存在多点只设置一点即可
Msg = "一起飞国际机票网",
MsgMaxContent = "信息框放大显示的内容,可以为空,不设置!",
MsgMaxTitle = "显示的标题, 可以为空,不设置!"
// ------------------------------------------------------------------
}
};
// 设置地图入参
Maps map = new Maps(AppId, inits, labels);
// 生成地图
MapScript.Text = map.ToString();
// 生成图片地图
ShowStaticMap.ImageUrl = map.ToImagePath(500, 500);
}
}

系统设置项

posted @ 2008-09-09 09:29 S.Sams 阅读(3140) | 评论 (40)编辑
     摘要:   阅读全文
posted @ 2008-08-11 21:15 S.Sams 阅读(20) | 评论 (0)编辑

非常讨厌在网页写文章, 写了半又没了, 又得重头来. 发下牢骚, 接着来!


实现功能:

     1. Tooltip

     2. Validate 表单验证

 

     可分开独立使用    

 

     您可以不写一行代码, 只需设置验证规则即可

 

     其实园子已经存在不少基于jQuery的验证插件, 如: http://www.cnblogs.com/wzmaodong/archive/2008/05/21/1203962.html

但感觉使用起来过于麻烦, 要实现在大堆表单的验证, javascript 代码一大堆. 所以这里的设计原则就是使用便捷, 易维护, 同时适应性大.

在验证中使用了自定义正则表达式, 这样用起来就非常方便了.  先看下最后的效果图

 

     1. 即时表单验证和提示

      

 

     2.  提交表单时验证

       

 

     下面看下我们如何在 asp.net 中实现便捷的提示功能和表单验证功能

     

 

 

Code

 

 

 

 以上的实现是不是很方便, 不用写大堆的 javascript 逻辑代码便可轻松实现验证和提示功能

 

通过调用 $(document).ready(function() {jQuery('input[tip],input[reg]').tooltip({onsubmit: true})}); 便完成数据的验证和提示功能. (该调用已集成在tooltip.js中)

onsubmit: true 这里设置是否触发 onsubmit 的提交验证事件.

 

再看看 CSS 的实现

 

 

 

.tooltipinputerr
{
    padding
: 2px 0 2px 18px;
    border
: solid 1px red;
    background
: #ffff99 url(/images/exclamation.png) no-repeat 2px center;
    
}

    
.tooltipinputok
{
    padding
: 2px 0 2px 18px;
    border
: solid 1px green;
    background
: url(/images/accept.png) no-repeat 2px center;
    
}

    
.tooltipshowpanel
{
    z-index
: auto;
    display
: none;
    position
:absolute;
    width
: 276px;
    height
: 35px;
    overflow
: hidden;
    text-indent
: 5px;
    line-height
: 40px;
    font-size
: 12px;
    font-family
: Arial;
    background
: url(/images/tooltop.gif) no-repeat left top;
    opacity
:0.9;
    filter
: alpha(opacity=90);
    
}

 

 

 

 

 使用方法:

     一.

Download jQuery

  二. 加入以上样式和引用tooltip.js文件

      

Tooltip.pack.js 1KB 0 2008/8/6 22:41:16
Tooltip.mini.js 1KB 0 2008/8/6 22:41:11
Tooltip.js 3KB 0 2008/8/6 22:41:04

 

 

 完整Demo下载  jquery-tooltip.rar 

 

     支持 Select Demo jquery-tooltip_select.rar

 

 

 版本更新下载: TooltipAndRegex.rar

 

posted @ 2008-08-07 00:09 S.Sams 阅读(3079) | 评论 (38)编辑

http://lab.berkerpeksag.com/jGrow

What is jGrow?

jGrow is a jQuery plug-in that makes the textarea adjust its size according to the length of the text.

It works smoothly with jQuery 1.2.x. It was tested on IE6/7, Firefox 2.0.x and Opera 9.x, and no bug was spotted yet.

非常好一个jQuery插件, 但原版不支持 Ctrl + V 的键盘操作事件, 直接代码.

 /* 原版代码.
 * jGrow 0.2
 * 08.02.2008
 * 0.2 release: 04.03.2008
 */
 
 (function($) {

  $.fn.jGrow = function(options) {

   var opts = $.extend({}, $.fn.jGrow.defaults, options);

   return this.each(function() {

    $(this).css({ overflow: "hidden" }).bind("keypress", function() {

     $this = $(this);

     var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

     if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {
      
      this.rows += 1;
      
     } else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if(o.rows != 0 && this.rows > o.rows) {

      $this.css({ overflow: "auto" });

     }

     $this.html();

    });

   });

  }

  $.fn.jGrow.defaults = { rows: 0 };

 })(jQuery);

 

以下为改进后的代码, 支持 Ctrl+V 键盘事件操作

 /*
 * jGrow 0.2
 * 08.02.2008
 * 0.2 release: 04.03.2008
 */
 
 // Updated by S.Sams 2008-07-24 21:47 以兼容Ctrl+V的操作
 
 (function($) {

  $.fn.jGrow = function(options) {

   var opts = $.extend({}, $.fn.jGrow.defaults, options);

   return this.each(function() {
   
    var isCtrl = false;
    
    $(this).css({ overflow: "hidden" }).bind("keypress", function() {
    
        $this = $(this);
       
     var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

     if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {
      
      this.rows += 1;
      
     } else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if(o.rows != 0 && this.rows > o.rows) {

      $this.css({ overflow: "auto" });

     }

     $this.html();

    }).bind("keydown",function(event){
    
        if(event.keyCode == 17) isCtrl = true;
          
    }).bind("keyup",function(event){

        if(isCtrl && event.keyCode == 86)
        {
         var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
            var getCL = this.value.split('\n').length
         if( getCL <= o.rows)
         {
             this.rows = getCL;
         }
         else
         {
             this.rows = o.rows;
             $(this).css({ overflow: "auto" });
         }
         isCtrl = false;
     }
    });

   });

  }

  $.fn.jGrow.defaults = { rows: 0 };

 })(jQuery);

 

 // 自适应 textarea 有内容存在的高度自动调整

 /*
 * jGrow 0.2
 * 08.02.2008
 * 0.2 release: 04.03.2008
 */

 // Updated by S.Sams 2008-07-24 21:47 以兼容Ctrl+V的操作

 (function($) {

  $.fn.jGrow = function(options) {

   var opts = $.extend({}, $.fn.jGrow.defaults, options);

   return this.each(function() {

    var isCtrl = false;

    $(this).css({ overflow: "hidden" }).bind("keypress", function() {

        $this = $(this);

     var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

     if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

      this.rows += 1;

     } else if(o.rows != 0 && this.rows > o.rows) {

      $this.css({ overflow: "auto" });

     }

     $this.html();

    }).bind("keydown",function(event){

        if(event.keyCode == 17) isCtrl = true;

    }).bind("keyup",function(event){

        if(isCtrl && event.keyCode == 86)
        {
         var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
            var getCL = this.value.split('\n').length
         if( getCL <= o.rows)
         {
             if(getCL > parseInt(this.rows))
                 this.rows = getCL;
         }
         else
         {
             this.rows = o.rows;
             $(this).css({ overflow: "auto" });
         }
         isCtrl = false;
     }
    });

    // Updated by S.Sams 2008-07-25
    // 修正 testarea 有内容存在的情况下的自动调整高度
    if($(this).val().length > 0)
    {
     var o = $.meta ? $.extend({}, opts, $(this).data()) : opts;
     var getCL = this.value.split('\n').length
     if( getCL <= o.rows)
     {
      if(getCL > parseInt(this.rows))
       this.rows = getCL;
     }
     else
     {
      this.rows = o.rows;
      $(this).css({ overflow: "auto" });
     }
    }

   });

  }

  $.fn.jGrow.defaults = { rows: 0 };

 })(jQuery);

posted @ 2008-07-24 21:57 S.Sams 阅读(292) | 评论 (1)编辑
//函数名:strByteLength
//功能介绍:返回字符串的字节长度
//参数说明:str    要检查的字符串
//返回值:字符串长度
function strByteLength(str)
{
    var i,sum;
    sum=0;
    for(i=0;i<str.length;i++)
    {
        if ((str.charCodeAt(i)>=0) && (str.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    return sum;
}

//函数名:fucCheckLength
//功能介绍:检查表单是否符合规定的长度
//参数说明:obj    要检查的表单对象
//        name   对象名称
//        length 规定长度
//返回值:true(符合) or false(不符)  
function fucCheckLength(obj , name , length)
{
    var i,sum;
    sum=0;
    var strTemp = obj.value;
    for(i=0;i<strTemp.length;i++)
    {
        if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    if(sum<=length)
    {
        return true;
    }
    else
    {
        alert(name+"超出规定长度!最长允许"+length+"个字符(中文算2位)!");
        obj.focus();
        return false;
    }
}

//检测电子邮件是否合法
function checkEmail(Object)
{
    var pattern = /^[.-_A-Za-z0-9]+@([-_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
    var strValue=Object.value;
    if(strValue.match(pattern)==null){
       alert("Email不合法,请重新填写!");
       Object.focus();
        return false;
     }else{
     return true;
     }
}


//去空隔函数
function Jtrim(str){
    var i = 0;
    var len = str.length;
    if ( str == "" ) return( str );
    j = len -1;
    flagbegin = true;
    flagend = true;
    while ( flagbegin == true && i< len){
        if ( str.charAt(i) == " " ){
            i=i+1;
            flagbegin=true;
        }else{
            flagbegin=false;
        }
    }

    while  (flagend== true && j>=0){
        if (str.charAt(j)==" "){
            j=j-1;
            flagend=true;
        }else{
            flagend=false;
        }
    }

    if ( i > j ) return ("")

    trimstr = str.substring(i,j+1);
    return trimstr;
}

//函数名:JtrimCn
//功能介绍:去掉字符串前后的空格[包括中文空格]
//参数说明:str    要操作的字符串
//返回值:删除了前后空格[包括中文空格]的字符串
function JtrimCn(str){
    var i = 0;

    if (str == null || str == undefined) {
        return "";
    }

    var len = str.length;
    if ( str == "" ) {
        return( str );
    }
    j = len -1;
    flagbegin = true;
    flagend = true;
    while ( flagbegin == true && i< len){
        if ( str.charAt(i) == " " || str.charAt(i) == " " ){
            i=i+1;
            flagbegin=true;
        }else{
            flagbegin=false;
        }
    }

    while  (flagend== true && j>=0){
        if (str.charAt(j)==" " || str.charAt(j) == " "){
            j=j-1;
            flagend=true;
        }else{
            flagend=false;
        }
    }

    if ( i > j ) {
        return ("")
    }
    var trimstr = str.substring(i,j+1);
    return trimstr;
}

//0-9,A-Z,a-z规范字符判断
function isChar(Str){
    var regu = "^([0-9a-zA-Z]+)$";
    var re = new RegExp(regu);
    if (Str.search(re) != -1){
        return true;
    }
    return false;
}

//判断是否数字
function IsNum(Str){
    var regu = "^([0-9]+)$";
    var re = new RegExp(regu);
    if (Str.search(re) != -1)
        return true;
    {
        return false;
    }
}

//函数名:funcIsNotEmpty
//功能介绍:检查字符串是否为空
//参数说明:str 字符串
//返回值:true:不为空    false:为空
function funcIsNotEmpty(str){
    var s = /\S/;
    if(str==null){
        return false;
    }
    return s.test(str);
}

//函数名:fucCheckLength
//功能介绍:检查表单是否符合规定的长度
//参数说明:objValue    要检查的表单对象的数值
//        name   对象名称
//        minLen 最小长度
//        maxLen 最大长度
//返回值:true(符合) or false(不符)  
function fucCheckLengthB(objValue , minLen , maxLen)
{
    var i,sum;
    sum=0;
    var strTemp = objValue;
    for(i=0;i<strTemp.length;i++)
    {
        if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
            sum=sum+1;
        else
            sum=sum+2;
    }
    if(sum<=maxLen && sum >= minLen)
    {
        return true;
    }
    else
    {
        return false;
    }
}

//sDate1和sDate2是2002-12-18格式
function funDateDiff(sDate1, sDate2){
    var aDate, oDate1, oDate2, iDays ;
    aDate = sDate1.split("-") ;
    //转换为12-18-2002格式
    oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
    aDate = sDate2.split("-") ;
    oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) ;
    //把相差的毫秒数转换为天数
    iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24);
    //如果开始时间小于结束时间
    if (sDate1 > sDate2)
    {
        return (-1 * iDays);
    }
    return iDays;
}

//检测电子邮件是否合法
function funcCheckEmail(strValue)
{
    var pattern = /^[.-_A-Za-z0-9]+@([-_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/;
    if(strValue.match(pattern)==null){
        return false;
     }else{
     return true;
     }
}

//函数名:fucCheckMaxLength
//功能介绍:检查表单是否符合规定的长度
//参数说明:objValue    要检查的表单对象的数值
//        name   对象数值
//        maxLen 最大长度
//返回值:true(符合) or false(不符)  
function fucCheckMaxLength(objValue , maxLen)
{
    return fucCheckLengthB(objValue, 0 ,maxLen );
}

//函数名:fucCheckMaxLength
//功能介绍:检查指定对象的数值是否符合规定的长度
//参数说明:objValue    要检查的表单对象的数值
//        name   对象
//        maxLen 最大长度
//返回值:true(符合) or false(不符)  
function fucCheckObjMaxLength(obj , maxLen)
{
    if (obj == null) {
        return false;
    }
    return fucCheckLengthB(obj.value, 0 ,maxLen );
}

//函数名:funcCheckInvalidChar
//功能介绍:判断指定的字段是否有非法字符<>
//参数说明:obj    要检查的表单对象
//返回值:true(没有) or false(有)  
function funcCheckInvalidChar(obj)
{
    if (obj == null || obj.value== "")
    {
        return true;
    }
    //alert(obj.value);
    var pattern = /[<>]/;
    if(pattern.test(obj.value)){
       return false;
        
     }else{
        return true;
     }
}

/**
 * 判断指定的ID的对象的最大长度是否正确
 * param: objId 对象ID
 *        maxLength  最大长度
 * return: true 正确 , false 不正确
 */
function lengthMaxCheckMsg(objId, maxLength, objName ,needFocus, showMsg) {
    //个人信息check
    var obj = document.getElementById(objId);
    if (!fucCheckObjMaxLength(obj, maxLength)) {
        if (showMsg == null || showMsg== "") {
            alert(objName + "最多只能输入" + (maxLength/2) + "个汉字(或" + maxLength + "个英文数字)");
        } else {
            alert(showMsg);
        }
        if (needFocus) {
            obj.focus();
        }
        return false;
    }
    return true;
}

/**
 * 判断指定的ID的对象的是否包含非法字符
 * param: objId 对象ID
 *        objName  对象的名称
 *        needFocus 是否需要设焦点
 *        showMsg 显示的错误消息
 * return: true 正确 , false 不正确
 */
function invalidCharCheckMsg(objId, objName,needFocus, showMsg) {
    //个人信息check
    var obj = document.getElementById(objId);

    if (!funcCheckInvalidChar(obj)) {
        if (showMsg == null || showMsg== "") {
            alert(objName + '中不能含有“<”或“>”');
        } else {
            alert(showMsg);
        }
        if (needFocus) {
            obj.focus();
        }
        return false;
    }
    return true;
}

/**
 * 判断指定的ID的对象是否为空
 * param: objId 对象ID
 *        objName  对象的名称
 *        needFocus 是否需要设焦点
 *        showMsg 显示的错误消息
 * return: true 不为空 , false 为空
 */
function emptyCheckMsg(objId, objName,needFocus, showMsg) {
    //个人信息check
    var obj = document.getElementById(objId);

    if (!funcIsNotEmpty(obj.value)) {
        if (showMsg == null || showMsg== "") {
            alert(objName + '不能为空!');
        } else {
            alert(showMsg);
        }
        if (needFocus) {
            obj.focus();
        }
        return false;
    }
    return true;
}

/*日期计算函数
 * date 2007-01-01
 * cnt  1 or -1
 * return 2007-01-02
 */
function getDate(date , cnt){
    if(date.length!=10){
        return "";
    }
    var dateArray = date.split("-")
    if(dateArray==null){
        return "";
    }
    var temDate = new Date(dateArray[0], dateArray[1]-1, dateArray[2]);
    var newDate = Date.UTC(temDate.getYear(),temDate.getMonth(),temDate.getDate())
    newDate = newDate + (cnt*24*60*60*1000);
    newDate = new Date(newDate);
    var month = newDate.getMonth()+1;
    var day =  newDate.getDate();
    if(Number(month)<10)
        month = "0"+month;
    if(Number(day)<10)
        day = "0"+day;
    var retDate = newDate.getYear() + "-" + month + "-" + day;
    return retDate;
}

//函数名:substringByByte
//功能介绍:截取字符串
//参数说明:objValue    要检查的表单对象的数值
//        length   要截取的长度[字节长度]
//返回值:截取得到的字符串  
function funcSubstringByByte(objValue ,length)
{
    var i,sum;
    sum=0;
    var strTemp = objValue;
    if (strTemp) {
        if (strTemp.length <= (Math.ceil(length / 2))) {
            return strTemp;
        }
        for(i=0;i<strTemp.length && sum <= length ;i++)
        {
            if ((strTemp.charCodeAt(i)>=0) && (strTemp.charCodeAt(i)<=255))
                sum=sum+1;
            else
                sum=sum+2;
        }
        
        if (sum > length) {
            return strTemp.substring(0,i - 1);
        } else {
            return objValue;
        }
    }
    return "";
}

//函数名:encodeHtml
//功能介绍:替换关键字
//参数说明:str    要替换的数据
//返回值:替换之后的数值
function encodeHtml(str){
    if (str) {
        return   str.replace(/>/g,   '&gt;').replace(/</g,   '&lt;').replace(/\'/g,   '&#039;').replace(/\"/g,   '&quot;').replace(/\r/g,   '<br   />');   
    }
    return str;
}
//函数名:decodeHTML
//功能介绍:替换关键字
//参数说明:str    要替换的数据
//返回值:替换之后的数值
function decodeHTML(val) {
    //alert("val=" + val);
    if (!val) return val;
    var dst = val;
    dst.replace( "&#039;",'\'');
    /**
    dst.replace(/&nbsp;/g, " ");
    dst.replace(/&quot;/g, "\"");
    dst.replace(/&gt;/g, ">");
    dst.replace(/&lt;/g, "<");
    dst.replace(/&amp;/g, "&");
    dst.replace(/&#039;/g, "'");
    **/
    //alert("dst=" + dst);
    return dst;
}

posted @ 2008-07-18 13:02 S.Sams 阅读(446) | 评论 (0)编辑

http://mediacdn.hongkongdisneyland.com.cn/html/hkdlch_v0101/staticPages/iasw/China/video/mv.flv

It's a world of laughter
A world of tears
It's a world of hopes
And a world of fears
There's so much that we share
That it's time we're aware
It's a small world after all

There is just one moon
And one golden sun
And a smile means
Friendship to ev'ryone
Though the mountains divide
And the oceans are wide
It's a small world after all

It's a small world after all
It's a small world after all
It's a small world after all
It's a sm

小小世界(普通话)
这是欢乐美丽的小世界
这是甜美幸福的小世界
啊 我们来跳舞
我们歌唱 歌唱美丽的小世界

这是一个小小世界
这是一个小小世界
这是一个小小世界
这是小世界

这是欢乐美丽的小世界
这是甜美幸福的小世界
啊 我们来跳舞
我们歌唱 歌唱美丽的小世界

这是一个小小世界
这是一个小小世界
这是一个小小世界
这是小世界

posted @ 2008-06-17 00:40 S.Sams 阅读(101) | 评论 (0)编辑
  1. Content-Type : (这个~很无语的东西,每次都记不住,现查!Wiki)
              application/octet-stream           万金油型,什么文件都适合!
              application/x-zip-compressed      专门针对Zip文件的,但是在某些情况下有奇效,这个后面讲
  2. Content-Disposition : 此属性设置内容输出的方式和属性,不大会使,常用就两种操作方式,一个是inline,另一个就是attachment;在输出类型之后可以跟着一些参数,在操作下载的时候如果我们不希望我们输出的文件编程abc.aspx的名字,就要设置filename的参数项,其他的参数项有:creation-date,modification-date,read-date,size。这些内容在后面讲高级的下载输出时会用得到哦。
posted @ 2008-06-16 15:36 S.Sams 阅读(54) | 评论 (0)编辑