oosumu

懒鬼,门外汉

博客园 首页 新随笔 联系 订阅 管理
首先,声明 private const String KEY_ID = "id";
private bool ReadQueryString(out int Id)
        
{
            Id 
= -1;
            
//
            
// Let this function throw an exception if the QueryString contains
            
// out of range or poorly formed data.
            
//
            String IdString = Request.QueryString[KEY_ID].ToString();
            
            
if ( IdString != String.Empty )
            
{
                Id 
= Int32.Parse(IdString);
            }

            
            ApplicationAssert.CheckCondition( Id 
>= 0"Invalid Item Id Number", ApplicationAssert.LineNumber);
            
            
return true;
        }
posted on 2004-12-22 15:54  - -  阅读(693)  评论(0编辑  收藏  举报