现在我给些代码看下 ,,帮我分析  有什么不足   
/*鑷姩鐢熸垚绫?
 *鐢熸垚鏃ユ湡锛?009-5-11
 */
using System;
using System.Data;
using System.Data.SqlClient;namespace Business
{
public class ShopPic:CSBase.DataRead.DataHandle
{
private int picId;
private string memberNo;
private string picName;
private string picUrl;
private string piceInfo;
public string PicId
{
get
{
return picId.ToString();
}
set
{
if (value == "")return;
try
{
picId = int.Parse(value);
}
catch
{
CSBase.DataRead.ErrorMessage.Message = "PicId 鏁版嵁绫诲瀷鍑洪敊!";
}
}
}
public string MemberNo
{
get
{
return memberNo.Trim();
}
set
{
memberNo = value;
}
}
public string PicName
{
get
{
return picName.Trim();
}
set
{
picName = value;
}
}
public string PicUrl
{
get
{
return picUrl.Trim();
}
set
{
picUrl = value;
}
}
public string PiceInfo
{
get
{
return piceInfo.Trim();
}
set
{
piceInfo = value;
}
}
public ShopPic()
{
}
public int DelShopPic()
{
////if (CSBase.DataRead.ErrorMessage.Message != "") return -1;
Data.ShopPic shopPic = new Data.ShopPic();
return shopPic.DelShopPic(picId);
}
public int InsShopPic()
{
////if (CSBase.DataRead.ErrorMessage.Message != "") return -1;
Data.ShopPic shopPic = new Data.ShopPic();
return picId = shopPic.InsShopPic(memberNo,picName,picUrl,piceInfo) > 0 ? (int)CSBase.DataRead.DataBase.LastAutoKey:0;
}
public DataTable SelShopPicByAll()
{
Data.ShopPic shopPic = new Data.ShopPic();
return Table = shopPic.SelShopPicByAll();
}
public DataTable SelShopPicByCount()
{
Data.ShopPic shopPic = new Data.ShopPic();
return Table = shopPic.SelShopPicByCount(memberNo);
}
public DataTable SelShopPicByMemberNoPageSize(int pageSize,int pageIndex)
{
Data.ShopPic shopPic = new Data.ShopPic();
return Table = shopPic.SelShopPicByMemberNoPageSize(memberNo,pageSize,pageIndex);
}
public DataTable SelShopPicByMemberNoPageSizePageIndex(int pageSize,int pageIndex)
{
Data.ShopPic shopPic = new Data.ShopPic();
return Table = shopPic.SelShopPicByMemberNoPageSizePageIndex(memberNo,pageSize,pageIndex);
}
public DataTable SelShopPicByMemberNotop5()
{
Data.ShopPic shopPic = new Data.ShopPic();
return Table = shopPic.SelShopPicByMemberNotop5(memberNo);
}
public DataTable SelShopPicByPicId()
{
Data.ShopPic shopPic = new Data.ShopPic();
return Table = shopPic.SelShopPicByPicId(picId);
}
public int UpdShopPic()
{
////if (CSBase.DataRead.ErrorMessage.Message != "") return -1;
Data.ShopPic shopPic = new Data.ShopPic();
return shopPic.UpdShopPic(picId,memberNo,picName,picUrl,piceInfo);
}
public int UpdShopPicByIsOne(bool isOne)
{
////if (CSBase.DataRead.ErrorMessage.Message != "") return -1;
Data.ShopPic shopPic = new Data.ShopPic();
return shopPic.UpdShopPicByIsOne(picId,isOne);
}
public int UpdShopPicByIsOne0(bool isOne)
{
////if (CSBase.DataRead.ErrorMessage.Message != "") return -1;
Data.ShopPic shopPic = new Data.ShopPic();
return shopPic.UpdShopPicByIsOne0(picId,memberNo,isOne);
}
public override bool GetValues(DataRow dataRow)
{
if (dataRow == null)return false;
try
{
if (Table.Columns.IndexOf("PicId")>=0)
{
picId = dataRow["PicId"]==System.DBNull.Value?0:(int)dataRow["PicId"];
}
if (Table.Columns.IndexOf("MemberNo")>=0)
{
memberNo = dataRow["MemberNo"]==System.DBNull.Value?"":(string)dataRow["MemberNo"];
}
if (Table.Columns.IndexOf("PicName")>=0)
{
picName = dataRow["PicName"]==System.DBNull.Value?"":(string)dataRow["PicName"];
}
if (Table.Columns.IndexOf("PicUrl")>=0)
{
picUrl = dataRow["PicUrl"]==System.DBNull.Value?"":(string)dataRow["PicUrl"];
}
if (Table.Columns.IndexOf("PiceInfo")>=0)
{
piceInfo = dataRow["PiceInfo"]==System.DBNull.Value?"":(string)dataRow["PiceInfo"];
}
return true;
}
catch (Exception e)
{
CSBase.DataRead.ErrorMessage.Message = e.Message;
return false;
}
}
public override void GetKeyPrimarys(ref object[] keyPrimarys)
{
if (PicId == null)return;
keyPrimarys = new object[Table.PrimaryKey.Length];
keyPrimarys[0] = PicId;
}
}
}

解决方案 »

  1.   


    <?xml version="1.0"?>
    <configuration>
      <configSections>
        <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
      </configSections>  <appSettings>
        <add key="imagesfolder" value="~/UpFile/File/"/>
        <add key="yuanimg" value="~/UpFile/File/"/>
        <add key="ConnectionString" value="server=222.77.98.78;database=ADIAN_SJTDI_COM;uid=sjtdi;pwd=sjtdi_adian; Enlist=true;Pooling=true;Max Pool Size = 5120;Min Pool Size=0; Connection Lifetime=30;packet size=1024" />
        <!--<add key="ConnectionString" value="server=libing;database=ewlcs;uid=sa;pwd=123;"/>-->
        <add key="MailUser" value=""/>
        <add key="MailPwd" value=""/>
        <add key="CustomErrorPage" value="Error.htm"/>
        <add key="MailServer" value="smtp.163.com"/>  </appSettings>
      <system.web>
        <!--<identity   impersonate="true"   userName="xml941"   password="xinmolou-100"   />-->
        <!--  动态调试编译
              设置 compilation debug="true" 以启用 ASPX 调试。否则,将此值设置为
              false 将提高此应用程序的运行时性能。
              设置 compilation debug="true" 以将调试符号(.pdb 信息)
              插入到编译页中。因为这将创建执行起来
              较慢的大文件,所以应该只在调试时将此值设置为 true,而在所有其他时候都设置为
              false。有关更多信息,请参考有关
              调试 ASP.NET 文件的文档。
        -->
        <pages validateRequest="false"/>
        <httpModules>
          <add name="MagicAjax" type="MagicAjax.MagicAjaxModule, MagicAjax"/>
          <add name="IPS" type="Safe3.Firewall,Safe3"/>
          <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />    </httpModules>
        <httpHandlers>
          <add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
          <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
          <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
        </httpHandlers>    <compilation debug="true" defaultLanguage="c#">
          <compilers>
            <compiler language="c#" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
               compilerOptions="/d:DEBUG;TRACE" />
          </compilers>
          <assemblies>
            <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
          </assemblies>
        </compilation>
        <!--  自定义错误信息
              设置 customErrors mode="On" 或 "RemoteOnly" 以启用自定义错误信息,或设置为 "Off" 以禁用自定义错误信息。 
              为每个要处理的错误添加 <error> 标记。          "On" 始终显示自定义(友好的)信息。
              "Off" 始终显示详细的 ASP.NET 错误信息。
              "RemoteOnly" 只对不在本地 Web 服务器上运行的
               用户显示自定义(友好的)信息。出于安全目的,建议使用此设置,以便 
               不向远程客户端显示应用程序的详细信息。
        -->
        <customErrors mode="Off"/>
        <!--  身份验证 
              此节设置应用程序的身份验证策略。可能的模式是 "Windows"、 
              "Forms"、 "Passport" 和 "None"          "None" 不执行身份验证。 
              "Windows" IIS 根据应用程序的设置执行身份验证 
                (基本、简要或集成 Windows)。在 IIS 中必须禁用匿名访问。
              "Forms" 您为用户提供一个输入凭据的自定义窗体(Web 页),然后 
               在您的应用程序中验证他们的身份。用户凭据标记存储在 Cookie 中。
              "Passport" 身份验证是通过 Microsoft 的集中身份验证服务执行的,
               它为成员站点提供单独登录和核心配置文件服务。
        -->
        <!--  授权 
               此节设置应用程序的授权策略。可以允许或拒绝不同的用户或角色访问
              应用程序资源。通配符: "*" 表示任何人,"?" 表示匿名
              (未经身份验证的)用户。
        -->
        <authentication mode="Forms">
          <forms name="admin" loginUrl="admin/login.aspx" protection="All" path="/"/>
        </authentication>
        <authorization>
          <allow users="*"/>
          <!-- 允许所有用户 -->
          <!--  <allow     users="[逗号分隔的用户列表]"
                                 roles="[逗号分隔的角色列表]"/>
                      <deny      users="[逗号分隔的用户列表]"
                                 roles="[逗号分隔的角色列表]"/>
                -->
        </authorization>
        <!--  应用程序级别跟踪记录
              应用程序级别跟踪为应用程序中的每一页启用跟踪日志输出。
              设置 trace enabled="true" 可以启用应用程序跟踪记录。如果 pageOutput="true",则
              在每一页的底部显示跟踪信息。否则,可以通过浏览 Web 应用程序
               根目录中的 "trace.axd" 页来查看
              应用程序跟踪日志。
        -->
        <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
        <!--  会话状态设置
              默认情况下,ASP.NET 使用 Cookie 来标识哪些请求属于特定的会话。
              如果 Cookie 不可用,则可以通过将会话标识符添加到 URL 来跟踪会话。
             若要禁用 Cookie,请设置 sessionState cookieless="true"。
        -->
        <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="200"/>
        <!--  全球化
              此节设置应用程序的全球化设置。
        -->
        <!--<globalization requestEncoding="Gb2312" responseEncoding="Gb2312"/>-->
        <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
        <xhtmlConformance mode="Legacy"/>
      </system.web>
      <RewriterConfig>
        <Rules>
          <RewriterRule>
            <LookFor>~/Index\.aspx</LookFor>
            <SendTo>~/Index.aspx</SendTo>
          </RewriterRule>
          <!-- 规则,可以使用正则表达式 -->
          <RewriterRule>
            <LookFor>~/wjTrade_(.[0-9]*)\.html</LookFor>
            <SendTo>~/BussinessShow.aspx?Menu_ID=$1</SendTo>
          </RewriterRule>
        </Rules>
      </RewriterConfig>
    </configuration>
      

  2.   

    以上是部分代码 访问网站地址为  http://www.ewlcs.com
      

  3.   

    工具要单元测试和集成测试
    看看cpu利用率