??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久无码精品亚洲日韩按摩 ,亚洲一区AV无码少妇电影,国产精品亚洲va在线观看http://m.tkk7.com/kiant/category/35695.html有才而性缓定属大才Q有气和斯为大智。h偏狭我受之以宽容Qh险仄我持之以坦荡。缓事宜急干Q敏则有功;急事宜缓办,忙则多措? --李叔?/description>zh-cnWed, 12 May 2010 12:18:47 GMTWed, 12 May 2010 12:18:47 GMT60[W记] 技?诀H:在ASP.NET中重写URL http://m.tkk7.com/kiant/articles/320564.html黄小?/dc:creator>黄小?/author>Tue, 11 May 2010 02:52:00 GMThttp://m.tkk7.com/kiant/articles/320564.htmlhttp://m.tkk7.com/kiant/comments/320564.htmlhttp://m.tkk7.com/kiant/articles/320564.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/320564.htmlhttp://m.tkk7.com/kiant/services/trackbacks/320564.html 原文地址Q?br /> 技?诀H:在ASP.NET中重写URL http://blog.joycode.com/scottgu/archive/2007/03/01/94004.aspx

Ҏ一Q用Request.PathInfo 参数而不是查询字W串
Ҏ二:使用HttpModule实现URL重写
Ҏ三:在IIS7中用HttpModule 实现无扩展名的URL重写
Ҏ四:在IIS5和IIS6中?ISAPIRewrite 来实现无扩展名的URL重写 
在URL重写里处理ASP.NET PostBack
正确地处理CSS和图像引?/a>


例程的URL重写场景
http://www.store.com/products.aspx?category=books
http://www.store.com/products.aspx?category=DVDs
http://www.store.com/products.aspx?category=CDs


Ҏ一Q用Request.PathInfo 参数而不是查询字W串


http://www.store.com/products.aspx/Books
http://www.store.com/products.aspx/DVDs
http://www.store.com/products.aspx/CDs
 

Ҏ二:使用HttpModule实现URL重写


http://www.store.com/products/Books.aspx
http://www.store.com/products/DVDs.aspx
http://www.store.com/products/CDs.aspx
 

Ҏ三:在IIS7中用HttpModule 实现无扩展名的URL重写


http://www.store.com/products/Books
http://www.store.com/products/DVDs
http://www.store.com/products/CDs       

      IIS 7.0使得处理q类情ŞҎ之极。你现在可以?IIS h道的Q何地Ҏ行一个HttpModuleQ这意味着你可以用上面的URLRewriter 模块来处理和重写无扩展名的URL(甚至是带?.aspQ?phpQ或 .jsp 扩展名的URL)。下面示范了你在IIS7中该如何配置Q?
<?xml version="1.0" encoding="UTF-8"?>

<configuration>

  
<configSections>
    
<section name="rewriter" 
             requirePermission
="false" 
             type
="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
  
</configSections>
  
  
<system.web>      
    
<httpModules>
      
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
    
</httpModules>    
  
</system.web>

  
<system.webServer>
    
<modules runAllManagedModulesForAllRequests="true">
      
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
    
</modules>
    
<validation validateIntegratedModeConfiguration="false" />
  
</system.webServer>

  
<rewriter>
    
<rewrite url="~/products/(.+)" to="~/products.aspx?category=$1" />
  
</rewriter>
  
</configuration> 



Ҏ四:在IIS5和IIS6中?ISAPIRewrite 来实现无扩展名的URL重写





在URL重写里处理ASP.NET PostBack


      当用URL重写Ӟ会出现这L问题Q?lt;form> 控g昄的URL不是原先h的URL(譬如Q?products/books)Q而是重写q后的URL(譬如Q?products.aspx?category=books)。这意味着Q当你做一个postback到服务器ӞURL不再是你原先q净利落的那个了?      在ASP.NET 2.0中,有个比较q净的诀H你可以用来重写<form>控g的action属性。具体地来说Q你可利用新的ASP.NET 2.0控g适配器扩展架构来定制控g的输出,用你提供的值来覆盖action属性的倹{这不要求在你的.aspx面里做M~码改动Q而只要在你的/app_browsers文g多wd一?browser文gQ注册用一个控仉配cd可输出新的action属性?br />

 
正确地处理CSS和图像引?br />

      不少人在W一ơ用URL重写Ӟ有时会遇上一个疑难杂症,是他们发现他们的图像和CSS样式表引用有时会停止工作。这是因Z们在HTML|页里有对这些文件的相对引用Q当你开始在应用里重写URLӞ你需要意识到览器经怼在不同的逻辑层次l构层上(logical hierarchy levels)h文gQ而不是实际存储在服务器上的东ѝ?

      譬如Q如果我们上面的/products.aspx|页?aspx |页里的logo.jpg有一个相对引用,但是通过 /products/books.aspxq个URL来请求的Q那么浏览器在显C网|Q将会发Z个对/products/logo.jpg的请求,而不是对/logo.jpg的请求。要正确地引用这个文Ӟ认你用根目录限定了(root qualify)CSS和图像引?“/style.css”Q而不?“style.css”)。对于ASP.NET控gQ你也可以?#8220;~”句法从你应用的根目录来引用文?譬如Q?lt;asp:image imageurl="~/images/logo.jpg" runat="server"/>) ?

  附:/Files/kiant/2010.05/UrlRewrite_HttpModule1.FormRewriter.cs.zip  附加CS版的文g


]]>
ASP.NET 会话状?/title><link>http://m.tkk7.com/kiant/articles/320456.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Mon, 10 May 2010 02:34:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/320456.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/320456.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/320456.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/320456.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/320456.html</trackback:ping><description><![CDATA[<br /> <a href="#1">1、ASP.NET 会话状?br /> </a><a href="#2">2、会话状态模?/a><br /> <a href="#3">3、ASP.NET在不同应用程序之间共享Session</a><br /> <a href="#4">4、Session无故丢失</a><br /> <a href="#5">5、客L使用Cookieless的方式存储Session信息<br /> </a><a href="#6">6、Session.SessionID 固定<br /> </a><br /> <br /> <a id="1" name="1"></a><br /> <p><strong>1、ASP.NET 会话状?/strong><br /> <br />       会话状态可在以下情况下使用Q存储特定于单独会话的短期信息,q且需要较高的安全性。不要在会话状态中存储大量的信息。需要注意,ؓ应用E序中每一会话的生存期创徏q维护会话状态对象。在支持许多用户的应用程序中Q这可能会占用大量服务器资源q媄响可~放性?p1 </p> <p>      ASP.NET 默认情况下将会话信息存储?ASP.NET 应用E序的内存空间。您可以使用一个独立的服务存储会话信息以便重新启动 ASP.NET 应用E序后会话信息仍然保留;或将会话信息存储?SQL Server 中以便会话信息可供网l场中的多个 Web 服务器用(重新启动 ASP.NET 应用E序后会话信息也会保留)Q或会话信息存储在自定义数据存储区。有x多信息,请参?a target="_blank">会话状态模?/a>?/p> <p>      除了会话状态外QASP.NET q提供在应用E序中保留数据的一些其他方式。有xU方式的比较Q请参见 <a target="_blank">ASP.NET 状态管理徏?/a>?p2<br /> <br /> ?<br /> *p1QASP.NET 状态管理徏?nbsp;<a >http://msdn.microsoft.com/zh-cn/library/z1hkazw7(v=VS.80).aspx</a><br /> *p2QASP.NET 会话状?nbsp;<a >http://msdn.microsoft.com/zh-cn/library/87069683(v=VS.80).aspx</a> <hr color="#3366ff" size="2" /> <a id="2" name="2"></a><br /> <strong>2、会话状态模?br /> </strong><br />       ASP.NET 会话状态支持若q用于会话数据的存储选项。每个选项都由 SessionStateMode 枚D中的一个值标识。下面的列表描述了可用的会话状态模式: <p> </p> <ul> <li>InProc 模式Q此模式会话状态存储在 Web 服务器上的内存中。这是默认设|。注意:它是唯一支持 Session_OnEnd 事g的模式?br /> <br /> <li>StateServer 模式Q此模式会话状态存储在一个名?ASP.NET 状态服务的单独q程中。这保了在重新启动 Web 应用E序时会保留会话状态,q让会话状态可用于|络Z的多?Web 服务器。注意:如果模式讄?StateServerQ则存储在会话状态中的对象必L可序列化的?br /> <br /> <li>SQLServer 模式Q将会话状态存储到一?SQL Server 数据库中。这保了在重新启动 Web 应用E序时会保留会话状态,q让会话状态可用于|络Z的多?Web 服务器。注意:如果?SQL Server 模式Q则存储在会话状态中的对象必L可序列化的?br /> <br /> <li>Custom 模式Q此模式允许您指定自定义存储提供E序?br /> <br /> <li>Off 模式Q此模式用会话状态?</li> </ul> <p>      通过在应用程序的 Web.config 文g中ؓ sessionState 元素?mode 属性分配一?SessionStateMode 枚D|可以指定要让 ASP.NET 会话状态用的模式。除?InProc ?Off 之外Q其他模式都需要附加参敎ͼ例如在本主题后面讨论的q接字符串倹{通过讉K System.Web.SessionState.HttpSessionState.Mode 属性的|可以查看当前选定的会话状态?p3<br /> <br /> 注:<br /> *p3Q会话状态模?nbsp;<a >http://msdn.microsoft.com/zh-cn/library/ms178586(v=VS.80).aspx</a> </p> <hr color="#3366ff" size="2" /> <a id="3" name="3"></a><br /> <p><strong>3、ASP.NET在不同应用程序之间共享Session</strong> *p4<br /> <br />       多个单独的应用程序,如何这些模块集中n份验证与授权q程</p> <p>Ҏ1Q?br /> 每个独立的Web应用E序攑ֈl一的解x案中Q实现v来复杂,易用性不高?br /> <br /> Ҏ2Q利用Session会话׃n<br /> InProc模式QSession被存储在IISq程中,每个虚拟目录是隔ȝQ所以无法共享Session?/p> <p>StateServer 模式Q虽然是独立的状态服务器Q进E)Q但在内存中q些应用E序q是隔离的?/p> <p>SQLServer 模式Q由于对Session的全部操作都是由存储q程来实现的Q而且存储q程未进行加密,可以通过修改存储q程的内部结构来辑ֈ׃n的目的?br /> <br />       ASPState数据库ASPStateTempApplications表中存储的是应用E序信息Q每个应用程序在启动的时候在q里会注册一条记录,包括应用E序的IDQ通过哈希法生成的)和应用程序名U。有多少个应用程序,在这个表里就对应多少条记录。那我们现在要做的是把这些记录变成一条记录,也就是要ƺ骗FrameworkQ让它认些不同的应用E序是同一个应用程序?br /> <br />       TempGetAppID存储q程Q这个存储过E是用于通过传递应用程序名U来得到应用E序ID信息的。每个应用程序在调用q个q程Ӟq个q程会去AspStateTempApplications中检查是否有相应的记录,如果没有Q就插入记录Q然后返回相应的ID?br /> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000">    </span><span style="color: #0000ff">ALTER</span><span style="color: #000000"> </span><span style="color: #0000ff">PROCEDURE</span><span style="color: #000000"> </span><span style="color: #ff0000">[</span><span style="color: #ff0000">dbo</span><span style="color: #ff0000">]</span><span style="color: #000000">.</span><span style="color: #ff0000">[</span><span style="color: #ff0000">TempGetAppID</span><span style="color: #ff0000">]</span><span style="color: #000000"><br />     </span><span style="color: #008000">@appName</span><span style="color: #000000">    tAppName,<br />     </span><span style="color: #008000">@appId</span><span style="color: #000000">      </span><span style="font-weight: bold; color: #000000">int</span><span style="color: #000000"> OUTPUT<br />     </span><span style="color: #0000ff">AS</span><span style="color: #000000"><br />     </span><span style="color: #0000ff">SET</span><span style="color: #000000"> </span><span style="color: #008000">@appName</span><span style="color: #000000"> </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="color: #ff00ff">LOWER</span><span style="color: #000000">(</span><span style="color: #008000">@appName</span><span style="color: #000000">)<br />     </span><span style="color: #008080">--</span><span style="color: #008080">变量值固定,使所有应用程序通用Z?/span><span style="color: #008080"><br /> </span><span style="color: #000000">    </span><span style="color: #0000ff">SET</span><span style="color: #000000"> </span><span style="color: #008000">@appName</span><span style="color: #000000"> </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="color: #ff0000">'</span><span style="color: #ff0000">/lm/w3svc/650056020/root/personnel/share</span><span style="color: #ff0000">'</span><span style="color: #000000"><br />     </span><span style="color: #0000ff">SET</span><span style="color: #000000"> </span><span style="color: #008000">@appId</span><span style="color: #000000"> </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="color: #0000ff">NULL</span><span style="color: #000000"><br /> <br />     </span><span style="color: #0000ff">SELECT</span><span style="color: #000000"> </span><span style="color: #008000">@appId</span><span style="color: #000000"> </span><span style="color: #808080">=</span><span style="color: #000000"> AppId<br />     </span><span style="color: #0000ff">FROM</span><span style="color: #000000"> </span><span style="color: #ff0000">[</span><span style="color: #ff0000">tempdb</span><span style="color: #ff0000">]</span><span style="color: #000000">.dbo.ASPStateTempApplications<br />     </span><span style="color: #0000ff">WHERE</span><span style="color: #000000"> AppName </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="color: #008000">@appName</span><span style="color: #000000"><br /> </span></div> <p><br /> 注:<br /> *p4QASP.NET在不同应用程序之间共享Session  <a >http://www.3qsoft.com/Article.aspx?ID=173</a> </p> <hr color="#3366ff" size="2" /> <a id="4" name="4"></a><br /> <strong>4、Session无故丢失</strong> *p5<br /> <br /> mode="InProc"  <br /> ==  <br /> 默认的配|方式很Ҏ丢失Session 请参?nbsp; <p>asp中Session的工作原理:  <br /> asp的Session是具有进E依赖性的。ASP Session状态存于IIS的进E中Q也是inetinfo.exeq个E序。所以当inetinfo.exeq程崩溃Ӟq些信息也就丢失。另外,重v或者关闭IIS服务都会造成信息的丢失?nbsp; </p> <p>原因1Q?nbsp; <br /> bin目录中的文g被改写,asp.net有一U机ӞZ保证dll重新~译之后Q系l正常运行,它会重新启动一ơ网站进E,q时׃DSession丢失Q所以如果有access数据库位于bin目录Q或者有其他文g被系l改写,׃DSession丢失  </p> <p>原因2Q?nbsp; <br /> 文g多w项中,如果没有打开“在单独的q程中打开文g夹窗?#8221;Q一旦新Z个窗口,pȝ可能认ؓ是新的Session会话Q而无法访问原来的SessionQ所以需要打开该选项Q否则会DSession丢失  </p> <p>原因3Q?nbsp; <br /> g大部分的Session丢失是客L引v的,所以要从客L下手Q看看cookie有没有打开  </p> <p>原因4Q?nbsp; <br /> Session的时间设|是不是有问题,会不会因旉成丢失  </p> <p>原因5Q?nbsp; <br /> IE中的cookie数量限制Q每个域20个cookieQ可能导致session丢失  </p> <p>原因6Q?nbsp; <br /> 使用web garden模式Q且使用了InProc mode作ؓ保存session的方?nbsp; </p> <p>解决丢失的经?nbsp; <br /> 1. 判断是不是原?造成的,可以在每ơ刷新页面的时候,跟踪bin中某个文件的修改旉  <br /> 2. 做Sessiond日志Q每ơ读写Session都要记录下来Qƈ且要记录SessionID、Session倹{所在页面、当前函数、函C的第几次Session操作Q这h丢失的原因会方便很多  <br /> 3. 如果允许的话Q徏议用state server或sql server保存sessionQ这样不Ҏ丢失  <br /> 4. 在global.asa中加入代码记录Session的创建时间和l束旉Q超旉成的Session丢失是可以在SessionEnd中记录下来的?nbsp; <br /> 5. 如果有些代码中用客L脚本Q如javascriptl护Session状态,p试调试脚本Q是不是因ؓ脚本错误引vSession丢失  </p> <p>问:Z么Session在有些机器上偶尔会丢失?  <br /> {:可能和机器的环境有关p,比如Q防火墙或者杀毒Y件等Q尝试关闭防火墙?nbsp; </p> <p>问:Z么当调用Session.Abandon时ƈ没有Ȁ发Session_EndҎQ?nbsp; <br /> {:首先Session_EndҎ只支持InProcQ进E内的)cd的Session。其ơ要Ȁ发Session_EndҎQ必d在SessionQ即pȝ中已l用Session了)Qƈ且至要完成一ơ请求(在这ơ请求中会调用该ҎQ?nbsp; </p> <p>问:Z么当我在InProc模式下用Session会经怸失?  <br /> {:该问题通常是由于应用程序被回收D的,因ؓ当用进E内SessionӞSession是保存在aspnet_wpq程中,当该q程被回收Session自然也就没有了,定该进E是否被回收可以通过查看pȝ的事件查看器获得信息?nbsp; <br /> 具体信息请参考:  <br /> Session variables are lost intermittently in ASP.NET applications  <br /> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316148  <br /> ?.0的时候也有一个bug会导致工作进E被回收q启,该bug已经?.1和sp2中修复?nbsp; <br /> 关于该bug的详l信息请参考:  <br /> ASP.NET Worker Process (Aspnet_wp.exe) Is Recycled Unexpectedly.  <br /> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q321792  </p> <p><br /> 问:什么类型的对象可以保存在Session里?  <br /> {:q依赖用的Session的模式,当用的是进E内QInProcQ的Session那么可以L的保存Q何对象。如果你使用了非InProc的模式,则只能保存可以序列化和反序列化的对象Q如果此时保存的对象不支持序列化Q则不能保存到这U模式(非InProcQ的Session里?nbsp; </p> <p>问:Z么在Session_End中不能用Response.Redirect和Server.TransferҎ跌{面Q?nbsp; <br /> {:Session_End是一个在服务器内部激发的事g处理函数。它是基于一个服务器内部的计时器的,在激发该事g时服务器上ƈ没有相关的HttpRequest对象Q因此此时ƈ不能使用Response.Redirect和Server.TransferҎ?nbsp; </p> <p>问:在Session_End中是否可以获得HttpContext对象Q?nbsp; <br /> {:不行Q因个事件ƈ没有和Q何的hQRequestQ相兌Q没有基于请求的上下文?nbsp; </p> <p>问:在Web Service中该如何使用SessionQ?nbsp; <br /> {:Z在Web Service中用SessionQ需要在Web Service的调用方做一些额外的工作Q必M存和存储调用Web Service时用的Cookie。详l信息请参考MSDN文档的HttpWebClientProtocol.CookieContainer属性。然而,如果你用代理服务器讉KWeb Service׃框架的限Ӟ两者不能共享Session?nbsp; </p> <p><br /> 问:当我使用webfarmӞ当我重定向到其他的Web服务器时SessionZ么会丢失Q?nbsp; <br /> {:详细信息请参考:  <br /> PRB: Session State Is Lost in Web Farm If You Use SqlServer or StateServer Session Mode  <br /> http://support.microsoft.com/default.aspx?scid=kb;en-us;325056  </p> <p>问:Session在global.asax中的那些事g中有效?  <br /> {:Session只有在AcquireRequestState事g之后有效Q该事g之后的事仉可以使用Session?nbsp; </p> <p><br /> 问:Z可以序讉KSession的状态|Session是否提供了锁定机Ӟ  <br /> {:Session实现了Reader/Writer的锁机制Q?nbsp; <br /> 当页面对Sessionh可写功能Q即面?<%@ Page EnableSessionState="True" %>标记Q,此时直到h完成该页面的Session持有一个写锁定?nbsp; <br /> 当页面对Sessionh只读功能Q即面?<%@ Page EnableSessionState="ReadOnly" %>标记Q,此时知道h完成该页面的Session持有一个读锁定?nbsp; <br /> 读锁定将d一个写锁定Q读锁定不会d读锁定;写锁定将d所有的d锁定。这是Z么两个框架中的同一个页面都d同一个SessionӞ其中一个要{待另一个(E快的那个)完成后,才开始写?nbsp; </p> <p>问:Sessionqx时意味着什么?  <br /> {:Sessionqx时意味着只要你的面讉KQ用)了SessionQ超时时间将被刷斎ͼ可以理解为重新计ӞQ即从该面h开始,重新计超时时间。但是,该页面不能禁用Session。它会自动的讉K当前面的SessionQ刷新超时时间?nbsp; </p> <p>问:在global.asax中的事g处理函数中SessionZ么无效?  <br /> {:依赖于在哪个事g处理函数中用SessionQSession在AcquireRequestState事g之后才有效,该事件之后的所有事件处理函数都可以使用SessionQ之前的则不能?nbsp; </p> <p><br /> 问:当我使用InProc模式保存SessionӞ此时的Session是保存在哪里Q?nbsp; <br /> {:不同的IIS的处理方式不同,  <br /> 当用的是IIS5的时候Session是保存在aspnet_wp.exe的进E空间里的?nbsp; <br /> 当用的是IIS6Ӟ默认情况下所有的应用E序׃n应用E序池,Session保存在w3wp.exe的进E空间中?nbsp; </p> <p>问:当页面出现错误后我的Session是否被保存Q我需要在Session_End中处理一些清理工作,但是p|了,Z么?  <br /> {:Session_End只有在Sessionq行在InProc模式下才会被执行。Session_End使用的帐hq行aspnet_wp工作q程的帐Pq个可以在machine.config中设|)。因此,如果在Session_EndҎ里,使用集成安全性链接到SQLQ它用aspnet_wpq程的帐h开链接Q此时成功与否则依赖于你的SQL的安全性设|?nbsp; </p> <p>问:在Session_End是我是否可以获得有效的HttpSessionState和HttpContext对象Q?nbsp; <br /> {:你可以在q个Ҏ中获得HttpSessionState对象Q可以直接用Session来访问即可。但是不能获得HttpContext对象Q因事gq没有和Mh相关联,因此不存在上下文对象?nbsp; </p> <p>问:在SQLServer模式下用SessionQؓ什么我的Session不过期?  <br /> {:在SqlServer模式下,Session的过期是通过SQL Agent的注册工作完成的Q请查你的SQL Agent是否q行Q?nbsp; </p> <p>问:当我讄EnableSessionState?#8220;ReadOnly”后,但是我在InProc模式下依然可以修改Session的|q是Z么?  <br /> {:即EnableSessionState标示为ReadOnlyQ但是在InProc模式下用户依然可以编辑Session。唯一不同的是Q在hq程中Session不会被锁住?nbsp; </p> <p>问:Z么在切换成SQLServer模式后我的请求被挂v了?  <br /> {:查在Session里面是否都保存的是可以保存在SQLServer模式下的对象Q即q些对象必须支持序列化?nbsp; </p> <p><br /> 问:当Session讄成cookieless后会有什么媄响?  <br /> {:当把cookieless讄成trueӞ主要会有下面的约束:  <br /> 1、在面中不能用绝寚w?nbsp; <br /> 2、在应用E序中在除了Http和Https之间的切换时需要完成一些其他的步骤?nbsp; <br /> 如果发送一个链接给其他人,此时的URL里面包含Session ID的信息,所以两个h公用一个Session?nbsp; <br /> <br /> 注:<br /> *p5QSession丢失 <a >http://topic.csdn.net/u/20081208/14/c154543c-8e86-406b-82a2-d3cc6f736b0d.html</a> </p> <hr color="#3366ff" size="2" /> <a id="5" name="5"></a><br /> <strong>5、客L使用Cookieless的方式存储Session信息</strong><br /> <br />       sessionState中的cookieless="false"改ؓQcookieless="true"Q这P客户端的Session信息׃再用Cookie存储了,而是其通过URL存储。关闭当前的IEQ打开一个新IEQ重新访问刚才的Web应用E序Q浏览器地址׃变ؓ http://localhost/MyTestApplication/(<strong>ulqsek45heu3ic2a5zgdl245</strong>)/default.aspx中黑体标出的是客户端的Session ID。注意,q段信息是由IIS自动加上的,不会影响以前正常的连接?*p6 <br /> <br /> 问:当Session讄成cookieless后会有什么媄响?  <br /> {:当把cookieless讄成trueӞ主要会有下面的约束:  <br /> 1、在面中不能用绝寚w?nbsp; <br /> 2、在应用E序中在除了Http和Https之间的切换时需要完成一些其他的步骤?nbsp; <br /> 如果发送一个链接给其他人,此时的URL里面包含Session ID的信息,所以两个h公用一个Session?*p7<br /> <br /> 注:<br /> *p6Q[ASP.NET] Session 详解  <a >http://www.blueidea.com/tech/program/2004/1856.asp</a><br /> *p7QSession丢失 <a >http://topic.csdn.net/u/20081208/14/c154543c-8e86-406b-82a2-d3cc6f736b0d.html</a> <hr color="#3366ff" size="2" /> <p> <a id="6" name="6"></a><br /> <strong>6、Session.SessionID 固定</strong></p> <ul> <li>IsNewSessionQ取得|指出工作階段是否以目前要求徏立?br /> <br /> <li>SessionIDQ取得工作階D늚唯一工作階段識別項?</li> </ul> <p>re: 因為Session在還沒裝物g之前, ID都不是固定的. 如果您c予Session內容, ex: Session["xxx"]=123 , 您會發現ID會固定. *p8<br /> <br /> 注:<br /> *p8Q[ASP.Net]Session.IsNewSession與Session.SessionID <a >http://www.dotblogs.com.tw/yilinliu/archive/2009/04/24/8163.aspx</a><br /> <hr color="#3366ff" size="2" /> <p> </p> <p> </p> <img src ="http://m.tkk7.com/kiant/aggbug/320456.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2010-05-10 10:34 <a href="http://m.tkk7.com/kiant/articles/320456.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asp.net获取|站路径http://m.tkk7.com/kiant/articles/320085.html黄小?/dc:creator>黄小?/author>Sat, 08 May 2010 16:02:00 GMThttp://m.tkk7.com/kiant/articles/320085.htmlhttp://m.tkk7.com/kiant/comments/320085.htmlhttp://m.tkk7.com/kiant/articles/320085.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/320085.htmlhttp://m.tkk7.com/kiant/services/trackbacks/320085.html
引用自:
asp.net获取|站路径
http://hi.baidu.com/zhangfengbang/blog/item/5f99d74b0ce661f883025cbc.html
HttpRequest 成员
http://msdn.microsoft.com/zh-cn/library/system.web.httprequest_members(v=VS.80).aspx
ASP.NET获取|站根目录的url的函敎ͼ很简?br /> http://www.xueit.com/html/2009-03/21_932_00.html
 



|站在服务器盘上的物理路径: HttpRuntime.AppDomainAppPath
虚拟E序路径: HttpRuntime.AppDomainAppVirtualPath


M于Request/HttpContext.Current{相关的Ҏ, 都只能在有请求上下文或者页面时使用. 卛_无请求上下文?HttpContext.Current为null. 而上面提到的Ҏ一直可?

对于全局Cache对象的访问亦?



CZQ输出asp.net |站路径?/strong> 

private void responseHtml()
    {
         System.Text.StringBuilder sb 
= new System.Text.StringBuilder();
  
//输出:当前旉: 2007-08-30 11:03:49
         sb.Append(string.Format("当前旉: {0}", Server.HtmlEncode(DateTime.Now.ToString())));
         sb.Append(
"<br />");

  
//当前h的虚拟\? /aDirectory/Sample/responseHtml.aspx
         sb.Append(string.Format("当前h的虚拟\? {0}",Server.HtmlEncode(Request.CurrentExecutionFilePath)));
         sb.Append(
"<br />");

  
//获取当前应用E序的根目录路径: /aDirectory
         sb.Append(string.Format("获取当前应用E序的根目录路径: {0}", Server.HtmlEncode(Request.ApplicationPath)));
         sb.Append(
"<br />");

  
//当前h的虚拟\? /aDirectory/Sample/responseHtml.aspx
         sb.Append(string.Format("当前h的虚拟\? {0}",Server.HtmlEncode(Request.FilePath)));
         sb.Append(
"<br />");

  
//当前h的虚拟\? /aDirectory/Sample/responseHtml.aspx
         sb.Append(string.Format("当前h的虚拟\? {0}",Server.HtmlEncode(Request.Path)));
         sb.Append(
"<br />");

  
//获取当前正在执行的应用程序的根目录的物理文gpȝ路径: E:\Visual Studio 2005\
         sb.Append(string.Format("获取当前正在执行的应用程序的根目录的物理文gpȝ路径: {0}", Server.HtmlEncode(Request.PhysicalApplicationPath)));
         sb.Append(
"<br />");

  
//获取与请求的 URL 相对应的物理文gpȝ路径: E:\Visual Studio 2005\\aDirectory\
         sb.Append(string.Format("获取与请求的 URL 相对应的物理文gpȝ路径: {0}", Server.HtmlEncode(Request.PhysicalApplicationPath)));
         sb.Append(
"<br />");
         Response.Write(sb.ToString());
     }

 



在ASP.NET~程中经帔R要用Request获取url的有关信?

试的url地址是http://www.test.com/testweb/default.aspx, l果如下Q?br /> Request.ApplicationPath:                     /testweb
Request.CurrentExecutionFilePath:       /testweb/default.aspx
Request.FilePath:                                /testweb/default.aspx
Request.Path:                                     /testweb/default.aspx
Request.PathInfo:
Request.PhysicalApplicationPath:          E:\WWW\testweb\
Request.PhysicalPath:                         E:\WWW\testweb\default.aspx
Request.RawUrl:                                 /testweb/default.aspx
Request.Url.AbsolutePath:                    /testweb/default.aspx
Request.Url.AbsoluteUri:                      http://www.test.com/testweb/default.aspx
Request.Url.Host:                                www.test.com
Request.Url.LocalPath:                        /testweb/default.aspx 

当url中带参数时可以?
HttpContext.Current.Request.Url.PathAndQuery.ToString()//

本页地址:   Request.URL; 

上页地址:  
Request.UrlReferrer  
Request.ServerViables["http_referer"]  
Request.RawUrl  
Request.RawUrl.QueryAndPath  
System.IO.Path.GetFileName(Request.FilePath.ToString()) 




获取|站根目录的url源代?/strong>--2010.05.09
http://www.xueit.com/html/2009-03/21_932_00.html

public static string GetRootURI()
    {
        
string AppPath = "";
        HttpContext HttpCurrent 
= HttpContext.Current;
        HttpRequest Req;
        
if (HttpCurrent != null)
        {
            Req 
= HttpCurrent.Request;
            
string UrlAuthority = Req.Url.GetLeftPart(UriPartial.Authority);
            
if (Req.ApplicationPath == null || Req.ApplicationPath == "/")
                
//直接安装?nbsp;  Web   站点   
                AppPath = UrlAuthority;
            
else
                
//安装在虚拟子目录?nbsp;  
                AppPath = UrlAuthority + Req.ApplicationPath;
        }
        
return AppPath;
    }

可修改ؓ静态属?/span> 

private
 static string rootURI;

    
/// <summary>
    
/// 获得|站根目录的url的函?br />     /// </summary>
    
/// <returns>应用E序根目?nbsp;eg:  http://www.xxx.net:2156/im </returns>
    public static string RootURI
    {
        
get
        {
            
if (string.IsNullOrEmpty(rootURI))
            {
                HttpContext HttpCurrent 
= HttpContext.Current;
                HttpRequest Req;
                
if (HttpCurrent != null)
                {
                    Req 
= HttpCurrent.Request;

                    
string UrlAuthority = Req.Url.GetLeftPart(UriPartial.Authority);
                    
if (Req.ApplicationPath == null || Req.ApplicationPath == "/")
                        
//直接安装?nbsp;  Web   站点   
                        rootURI = UrlAuthority;
                    
else
                        
//安装在虚拟子目录?nbsp;  
                        rootURI = UrlAuthority + Req.ApplicationPath;
                }
            }

            
return rootURI;
        }
    }



]]>
asp.net对于囑փ文g的操?-存储、读取访?/title><link>http://m.tkk7.com/kiant/articles/320052.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Tue, 04 May 2010 07:41:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/320052.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/320052.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/320052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/320052.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/320052.html</trackback:ping><description><![CDATA[<p>内容引用自:<br /> 菜鸟问题,高分求解:关于SQL Server存储囄的问?br /> http://topic.csdn.net/t/20050415/20/3940356.html</p> <p>数据库中Imagecd的数据的存取(For C#/ASP.NET)<br /> http://www.cnblogs.com/billsfeng/archive/2008/07/31/1257579.html</p> <p>SQL Server存储囑փ数据的策略与Ҏ <br /> http://www.yesky.com/20030113/1648152.shtml<br /> <br /> How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET<br /> http://support.microsoft.com/default.aspx?scid=kb;EN-US;309158<br /> </p> <br /> <br /> <hr color="#999999" size="4" /> <strong>1、图片存?/strong><br /> <br /> a.存储于数据库<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000">         在大多数情况下,最好把囄文g与其它数据一起存在数据库中。因为将影像数据文g存储在数据库中有许多优点Q?br /> <br />   <strong>易于理</strong> 当BLOB与其他数据一起存储在数据库中ӞBLOB和表格是数据一起备份和恢复。这样就降低了表格数据与BLOB数据不同步的ZQ而且降低了其他用h意中删除了文件系l中BLOB数据位置的\径和风险。另外,数据存储在数据库中BLOB和其他数据的插入、更新和删除都在同一个事务中实现。这样就保了数据的一致性和文g与数据库之间的一致性。还有一点好处是不需要ؓ文gpȝ中的文g单独讄安全性?br /> <br />   <strong>可׾~?/strong> 管文gpȝ被设计ؓ能够处理大量不同大小的对象,但是文gpȝ不能对大量小文gq行优化。在q种情况下,数据库系l可以进行优化?br /> <br />   <strong>可用?/strong> 数据库具有比文gpȝ更多的可用性。数据库复制允许在分布式环境中复制、分配和潜在的修Ҏ据。在ȝl失效的情况下,日志转移提供了保留数据库备用副本的方法?/span></div> <em style="font-size: 8pt">引自QSQL Server存储囑փ数据的策略与Ҏ</em><br /> <br /> <br /> b.存储于文件系l? <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #000000">当然Q在某些情况下,图片存储在文gpȝ中将是更好的选择Q?img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />Q?/span><span style="font-weight: bold; color: #800000">1</span><span style="color: #000000">Q用图片的应用E序需要数据流性能Q例如实时的视频重现?img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />Q?/span><span style="font-weight: bold; color: #800000">2</span><span style="color: #000000">Q象Microsoft PhotoDraw或者Adobe Photoshopq样的应用程序经常访问BLOBQ这些应用程序只知道怎样讉K文g?br /> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />Q?/span><span style="font-weight: bold; color: #800000">3</span><span style="color: #000000">Q需要用一些NTFS文gpȝ中的Ҏ功能Q例如远E存储?/span></div> <em style="font-size: 8pt">引自QSQL Server存储囑փ数据的策略与Ҏ</em><br /> <br /> <br />     Q减L据库处理负担,也可以徏立专门的文g服务器存攑֛片和视频.<br /> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>2、数据库存储及读取图片数?/strong><br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="font-weight: bold; color: #800000">1</span><span style="color: #000000">.Image囑փ文g存入到数据库?nbsp; 我们知道数据库里的Imagecd的数据是"二进制数?,因此必须图像文件{换成字节数组才能存入数据库中.<br /> <br /> </span><span style="font-weight: bold; color: #800000">2</span><span style="color: #000000">.从SQL Server数据库读取Imagecd的数?q{换成bytes</span><span style="color: #ff0000">[]</span><span style="color: #000000">或Image囑փ文g</span></div> <em style="font-size: 8pt">引自Q数据库中Imagecd的数据的存取(For C#/ASP.NET)</em><br /> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>3、asp.net中自定义对图片文件的讉K</strong><br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000">web.config<br /> <br />   </span><span style="color: #0000ff"><</span><span style="color: #800000">system</span><span style="color: #ff0000">.web</span><span style="color: #0000ff">></span><span style="color: #000000"> </span><span style="color: #008000"><!--</span><span style="color: #008000"> vs调试、iis6 </span><span style="color: #008000">--></span><span style="color: #000000">   <br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">httpHandlers</span><span style="color: #0000ff">></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">path</span><span style="color: #0000ff">="*.jpg"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">path</span><span style="color: #0000ff">="*.jpeg"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">path</span><span style="color: #0000ff">="*.png"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">path</span><span style="color: #0000ff">="*.bmp"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">httpHandlers</span><span style="color: #0000ff">></span><span style="color: #000000"><br />   </span><span style="color: #0000ff"></</span><span style="color: #800000">system.web</span><span style="color: #0000ff">></span><span style="color: #000000"><br />   </span><span style="color: #0000ff"><</span><span style="color: #800000">system</span><span style="color: #ff0000">.webServer</span><span style="color: #0000ff">></span><span style="color: #008000"><!--</span><span style="color: #008000"> iis7 </span><span style="color: #008000">--></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"><</span><span style="color: #800000">handlers</span><span style="color: #0000ff">></span><span style="color: #000000">      <br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jpgMark"</span><span style="color: #ff0000"> path</span><span style="color: #0000ff">="*.jpg"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="jpegMark"</span><span style="color: #ff0000"> path</span><span style="color: #0000ff">="*.jpeg"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="pngMark"</span><span style="color: #ff0000"> path</span><span style="color: #0000ff">="*.png"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />       </span><span style="color: #0000ff"><</span><span style="color: #800000">add </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="bmpMark"</span><span style="color: #ff0000"> path</span><span style="color: #0000ff">="*.bmp"</span><span style="color: #ff0000"> verb</span><span style="color: #0000ff">="*"</span><span style="color: #ff0000"> type</span><span style="color: #0000ff">="包名.ImageHandler, dll文g"</span><span style="color: #ff0000"> </span><span style="color: #0000ff">/></span><span style="color: #000000"><br />     </span><span style="color: #0000ff"></</span><span style="color: #800000">handlers</span><span style="color: #0000ff">></span><span style="color: #000000"><br />   </span><span style="color: #0000ff"></</span><span style="color: #800000">system.webServer</span><span style="color: #0000ff">></span></div> <br /> ImageHandler 囄~放与水印效?br /> http://m.tkk7.com/kiant/articles/317469.html<br /> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>4、其他组?/strong><br /> <br /> Persits AspJpeglg囄水印\~略图\囄合ƈ\囄切割\实例教程<br /> http://www.aspxhome.com/asp/component/200812/620614.htm<br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000"><strong>AspJpeg功能摘要</strong><br /> 支持JPEG, GIF, BMP, TIFF ?nbsp;PNG 格式囄. 输出格式始终?nbsp;JPEG<br /> 源图片可以来源于盘、内存、或者记录集Q数据库Q?br /> ~略囄可以保存到磁盘、内存、或者HTTP?br /> 支持三种更改大小方式: nearest-neighbor, bilinear, and bicubic. <br /> 可以在图片之上添加图片或者文? <br /> 支持M?br /> 支持复制Q反转,旋{Q锐化,灰度调节.<br /> 可以调节压羃比率Q以得到最佌出效果和大小. <br /> 从Jpeg囄中抽取EXIF ?nbsp;IPTC数据.<br /> CMYK-RGB转换<br /> Read/write access to individual pixels of an image. Q从图象中对L象素q行?写存取。)</span></div> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>5、C# 处理GIF 囄的问题?Q分不够Q还有)</strong><br /> http://topic.csdn.net/t/20060703/11/4856635.html<br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000">8 楼tzzzcQ冷剑)回复?nbsp;2006-07-03 13:33:19 得分 0 <br /> to:Knight94(愚翁)   <br />   Graphics   myImg   =   Graphics.FromImage(zoomImg);//创徏Graphics   <br />   在最后一句出现问?处理GIF   囄时候,提示无法从带有烦引像素格式的囑փ创徏   Graphics)Q老提C:A   Graphics   object   cannot   be   created   from   an<br /> <br /> <br /> 9 楼Knight94Q愚)回复?nbsp;2006-07-03 13:41:34 得分 0<br />  不要用gif囑փ直接生成graphics对象Q?nbsp;  <br />     <br />   处理程Q?nbsp;  <br />   1、gif   分解成png或者jpg文gl;   <br />   2、对每个png或者jpg文gq行处理Q?nbsp;  <br />   3、把处理好的png或者jpg文gl,q行合成一个gif?nbsp;  </span></div> <br /> <br /> <br /> <hr color="#999999" size="4" /> <strong>6、ASP.NET输出PNG囄时出现GDI+一般性错误的解决Ҏ</strong><br /> 详细出处参考:http://www.jb51.net/article/17063.htm<br /> <br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #000000">Response.ContentType = "image/PNG"; <br /> using (MemoryStream ms = new MemoryStream()) <br /> { <br /> img.Save(ms, ChartFormat.Png); <br /> Response.OutputStream.Write(ms.GetBuffer(), 0, (int)ms.Length); <br /> } <br /> <br /> 可以输入png囄了?nbsp;<br /> q是׃Response.OutputStreamq个的无法往回读取造成的,也就是它的CanSeek属性是false。png囑փ生成的时候不像jpegQ不是流式的Q已l写入的׃再管了,而是需要往回不断地写入l构数据。但是response无法往回seekQ所以直接用׃行了。改成一个可以seek的MemoryStreamQ先生成好png囄Q然后再输出到response?nbsp;</span></div> <img src ="http://m.tkk7.com/kiant/aggbug/320052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2010-05-04 15:41 <a href="http://m.tkk7.com/kiant/articles/320052.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转] DataBinder.Eval用法http://m.tkk7.com/kiant/articles/319195.html黄小?/dc:creator>黄小?/author>Tue, 27 Apr 2010 05:15:00 GMThttp://m.tkk7.com/kiant/articles/319195.htmlhttp://m.tkk7.com/kiant/comments/319195.htmlhttp://m.tkk7.com/kiant/articles/319195.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/319195.htmlhttp://m.tkk7.com/kiant/services/trackbacks/319195.html 转自Q?br /> [ASP.NET]DataBinder.Eval用法
http://www.cnblogs.com/march3/archive/2007/05/22/755534.html

 

<%# Bind("Subject") %> //l定字段
<%# Container.DataItemIndex + 1%> //实现自动~号
<%# DataBinder.Eval(Container.DataItem, "[n]") %>

通常使用的方?br /> <%# DataBinder.Eval(Container.DataItem, "ColumnName") %>
<%# DataBinder.Eval(Container.DataItem, "ColumnName", null) %>
<%# DataBinder.Eval(Container, "DataItem.ColumnName", null) %>

其他用法
<%# ((DataRowView)Container.DataItem)["ColumnName"] %>
<%# ((DataRowView)Container.DataItem).Row["ColumnName"] %>
<%# ((DataRowView)Container.DataItem)["adtitle"] %>
<%# ((DataRowView)Container.DataItem)[n] %>
<%# ((DbDataRecord)Container.DataItem)[0] %>
<%# (((自定义类?Container.DataItem)).属?ToString() %>//如果属性ؓ字符串类型就不用ToString()?/p>

DataBinder.Eval用法范例
<%# DataBinder.Eval(Container.DataItem, "IntegerValue", "{0:c}") %>
格式化字W串参数是可选的。如果忽略参敎ͼDataBinder.Eval q回对象cd的|

//昄二位数
<%# DataBinder.Eval(Container.DataItem, "UnitPrice", "${0:F2}") %>
//{0:G}代表昄True或False
<ItemTemplate>
 <asp:Image Width="12" Height="12" Border="0" runat="server"
 AlternateText='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "{0:G}") %>'
 ImageUrl='<%# DataBinder.Eval(Container.DataItem, "Discontinued", "~/images/{0:G}.gif") %>' />
</ItemTemplate>
//转换cd
((string)DataBinder.Eval(Container, "DataItem.P_SHIP_TIME_SBM8")).Substring(4,4)
{0:d} 日期只显C年月日
{0:yyyy-mm-dd} 按格式显C年月日
{0:c} 货币样式
<%#Container.DataItem("price","{0:K?,##0.00}")%>
<%# DataBinder.Eval(Container.DataItem,"Company_Ureg_Date","{0:yyyy-M-d}")%>


Specifier Type     Format   Output (Passed Double 1.42)  Output (Passed Int -12400)
c  Currency        {0:c}     $1.42     -$12,400
d  Decimal         {0:d}    System.FormatException  -12400
e  Scientific      {0:e}    1.420000e+000    -1.240000e+004
f  Fixed point     {0:f}  1.42    -12400.00
g  General         {0:g}  1.42     -12400
n  Number with commas for thousands  {0:n}  1.42     -12,400
r  Round trippable    {0:r}  1.42     System.FormatException
x  Hexadecimal    {0:x4}  System.FormatException   cf90


{0:d} 日期只显C年月日
{0:yyyy-mm-dd} 按格式显C年月日


样式取决?Web.config 中的讄

{0:c}  ?{0:K?,000.00} 货币样式  标准英国货币样式
<system.web>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
</system.web>
昄?K?,000.10

{0:c}  ?string.Format("{0:C}", price); 中国货币样式
<system.web>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-cn" uiCulture="zh-cn" />
</system.web>
昄?K?,000.10

{0:c}  ?string.Format("{0:C}", price); 国货币样式
<system.web>
      <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
昄?$3,000.10

 

DataBinder.Eval(Container.DataItem,"Name")和Container.DataItem("Name")有什么区别?
DataBinder是System.Web里面的一个静态类Q它提供?span style="color: #0000ff">EvalҎ用于化数据绑定表辑ּ的编?/span>Q但是它使用的方式是通过Reflection{开销比较大的Ҏ来达到易用性,因此其性能q不是最好的。而Container则根本不是Q何一个静态的对象或方法,它是ASP.NET面~译器在数据l定事g处理E序内部声明的局部变量,其类型是可以q行数据l定的控件的数据容器cdQ如在Repeater内部的数据绑定容器叫RepeaterItemQ,在这些容器类中基本都有DataItem属性,因此你可以写Container.DataItemQ这个属性返回的是你正在被绑定的数据源中的那个数据项。如果你的数据源是DataTableQ则q个数据的cd实际是DataRowView?br />



数据l定以及Container.DataItem几种方式与用法分?/strong>
http://blog.csdn.net/jelink/archive/2006/08/25/1118839.aspx

 

l定到集?<asp:ListBox id="ListBox1" datasource='<%# myArray%>' runat="server">

<%@ Import namespace="System.Data" %> 
<%# ((DataRowView)Container.DataItem)["xxxx"]%> 




What's the deal with Databinder.Eval and Container.DataItem?
http://weblogs.asp.net/rajbk/archive/2004/07/20/what-s-the-deal-with-databinder-eval-and-container-dataitem.aspx

 

<href='<%#  Databinder.Eval(Container.DataItem,"ID","default.aspx?CategoryId={0}" ) %>'>


re: What's the deal with Databinder.Eval and Container.DataItem? 

Answering the question.

<%If DataBinder.Eval(Container.DataItem, "DATAFIELD"<> "" Then

   Response.Write(
"something")

End If %>

Try this.

<%# DataBinder.Eval(Container.DataItem, "DataField").Equals("")?"":"Something"%>


Thursday, August 02, 2007 11:23 PM by someone 




]]>
[转]Response.Redirect(),Server.Transfer(),Server.Execute()的区?/title><link>http://m.tkk7.com/kiant/articles/319194.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Fri, 23 Apr 2010 05:56:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/319194.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/319194.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/319194.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/319194.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/319194.html</trackback:ping><description><![CDATA[<br /> 内容转自Q?br /> Response.Redirect(),Server.Transfer(),Server.Execute()的区?br /> http://www.cnblogs.com/3stones/archive/2008/03/20/1114645.html<br /> <br /> <br /> <p><strong>1、Response.Redirect():</strong><br />       Response.RedirectҎD览器链接到一个指定的URL。当Response.Redirect()Ҏ被调用时Q它会创Z个应{,应答头中指出了状态代?02Q表C目标已l改变)以及新的目标URL。浏览器从服务器收到该应{,利用应答头中的信息发Z个对新URL的请求?br />   <br />       q就是说Q用Response.RedirectҎ旉定向操作发生在客LQ?span style="color: #0000ff">d涉及Cơ与服务器的通信Q两个来回)Q?/span>W一ơ是对原始页面的hQ得C?02应答Q第二次是请?02应答中声明的新页面,得到重定向之后的面?br /> </p> <p><strong>2、Server.Transfer</strong>    <br />       Server.transfer是IIS 5.0新增加的一个功能。它解决了Response.Redirect的两个重要的~陷Q?br />       1Q在Response.Redirect中,我们得不CQ何第一늚输出<br />       2QResponse.Redirect会丢失request中的所有属性,当然我们可以通过一些其他的办法Q比如session来搞定,可是Q有些页的参数是在request中传q来的,q样的话Q就不行?br />      3)  Response.Redirect需要client端再发v一个请求?br /> <br />       Server.transfer很好地解决了这些问题。它是从server端直接向下一发赯求,不需要client再次发送请求。如果你的网非怾赖response.redirectQ这个小的改变可以提高近25%的效率(Ҏ微Y文档Q?/p> <p>      Server.TransferҎ<span style="color: #0000ff">把执行流E从当前的ASPX文g转到同一服务器上的另一个ASPX面</span>。调用Server.TransferӞ当前的ASPX面l止执行Q执行流E{入另一个ASPX面Q但新的ASPX面仍用前一ASPX面创徏的应{流?br />   <br />       如果用Server.TransferҎ实现面之间的导航,<span style="color: #0000ff">览器中的URL不会改变</span>Q因为重定向完全在服务器端进行,览器根本不知道服务器已l执行了一ơ页面变换?br />   <br />       默认情况下,Server.TransferҎ不会把表单数据或查询字符串从一个页面传递到另一个页面,但只要把该方法的W二个参数设|成TrueQ就<span style="color: #0000ff">可以保留W一个页面的表单数据和查询字W串</span>?br />   <br />       同时Q用Server.Transfer时应<span style="color: #ff0000">注意一?/span>Q目标页面将使用原始面创徏的应{流Q这DASP.NET的机器验证检查(Machine Authentication CheckQMACQ认为新面的ViewState已被改。因此,如果要保留原始页面的表单数据和查询字W串集合Q必L目标面Page指o?EnableViewStateMac属性设|成False?/p> <p>      Server.Transfer()有一?span style="color: #ff0000">不是Q?/span>当用户在a.aspx中提交了一个表?然后用Server.Transfer()q入 b.aspxQ这时如果用户刷C下页面,览器便会问用户是否“重试”发送表单,如果用户点击“?#8221;Q那么,表单中的数据被重新发送到服务器。如发送表单的作用是Z向数据库中插入一条记录,l果g希望发生的事——同一表单被多ơ加入到数据库中?/p> <p><br /> <br /> <strong>3、Server.Execute</strong>  <br />       Server.ExecuteҎ允许<span style="color: #0000ff">当前的ASPX面执行一个同一Web服务器上的指定ASPX面</span>Q当指定的ASPX面执行完毕Q控制流E重新返回原面发出Server.Execute调用的位|。这U页面导航方式类g针对ASPX面的一ơ函数调用,<span style="color: #ff0000">被调用的面能够讉K发出调用面的表单数据和查询字符串集?/span>Q所以要把被调用面Page指o的EnableViewStateMac属性设|成False?br /> <br /> </p> <p><strong>4.</strong><br /> Server.Execute("another.aspx")和Server.Transfer("another.aspx")区别:  <br /> Execute是从当前面转移到指定页?q将执行q回到当前页?nbsp; <br /> Transfer是将执行完全转移到指定页?</p> <p><br /> <strong>ȝQ?br /> </strong>在网l状态较好的情况?Redirect(url)Ҏ效率最?! 可重定向到同一台或非同一台服务器上的aspx或非aspxQhtmlQ资?nbsp;  <span style="color: #0000ff"> *重定?br /> </span>Server.TransferҎ和Server.ExecuteҎ最灉|!! 但只能{到同一Application目录下,也有可能D不期望的l果发生    <span style="color: #0000ff">*转发<br /> </span>Server.ExecuteҎ占用资源最?     <span style="color: #0000ff">*包含<br /> </span><br /> <font color="#0000ff">ps. *ؓW记</font></p> <img src ="http://m.tkk7.com/kiant/aggbug/319194.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2010-04-23 13:56 <a href="http://m.tkk7.com/kiant/articles/319194.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Enterprise Library 4 ?DAAB使用http://m.tkk7.com/kiant/articles/317510.html黄小?/dc:creator>黄小?/author>Mon, 05 Apr 2010 14:26:00 GMThttp://m.tkk7.com/kiant/articles/317510.htmlhttp://m.tkk7.com/kiant/comments/317510.htmlhttp://m.tkk7.com/kiant/articles/317510.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/317510.htmlhttp://m.tkk7.com/kiant/services/trackbacks/317510.html 引用自:
Enterprise Library 2.0 -- Data Access Application Block 和 加密数据库连接字W串
http://www.cnblogs.com/adamoooo/articles/892618.html



取得存储q程的返回倹{输出参?br />
 带输出参数的Q?/strong>
            try
            {
                Database db 
= DatabaseFactory.CreateDatabase();
                DbCommand cmd 
= db.GetStoredProcCommand("usp_xxx");

                db.AddParameter(cmd, 
"@UserID", DbType.Int32, ParameterDirection.InputOutput, "", DataRowVersion.Current, dict.Get("UserID"0));
                db.AddInParameter(cmd, 
"@LoginName", DbType.String, dict["LoginName"]);
                

                db.ExecuteNonQuery(cmd);
                
return DictionaryEx.Create("UserID", db.GetParameterValue(cmd, "@UserID"));
            }
            
catch (Exception)
            {
                
return null;
            }        



带返回|
try
            {
                Database db 
= DatabaseFactory.CreateDatabase();
                DbCommand cmd 
= db.GetStoredProcCommand("usp_xxx");
                db.AddInParameter(cmd, 
"@UserID", DbType.Int32, dict["UserID"]);
                
                db.AddParameter(cmd, 
"@ret", DbType.Int32, ParameterDirection.ReturnValue, "", DataRowVersion.Default, null);
                db.ExecuteNonQuery(cmd);

                
return cmd.Parameters["@ret"].Value;
            }
            
catch (Exception)
            {
                
return null;
            }



查询q回l果集:
try
            {
                Database db 
= DatabaseFactory.CreateDatabase();
                DbCommand cmd 
= db.GetStoredProcCommand("usp_xxx");
                db.AddInParameter(cmd, 
"@rowStart", DbType.Int32, dict.Get("rowStart"null));
                db.AddInParameter(cmd, 
"@rowEnd", DbType.Int32, dict.Get("rowEnd"null));

                
return db.ExecuteDataSet(cmd);
            }
            
catch (Exception)
            {
                
return null;
            }



]]>
存储q程q回的多l果集数据,ado 讉K调用http://m.tkk7.com/kiant/articles/294666.html黄小?/dc:creator>黄小?/author>Fri, 11 Sep 2009 00:17:00 GMThttp://m.tkk7.com/kiant/articles/294666.htmlhttp://m.tkk7.com/kiant/comments/294666.htmlhttp://m.tkk7.com/kiant/articles/294666.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/294666.htmlhttp://m.tkk7.com/kiant/services/trackbacks/294666.html 存储q程q回的多l果集数据,ado怎么打开q些l果集ƈ取得数据Q?/a>


SqlDataAdapter   myDataAdapter   =   new   SqlDataAdapter("GetRecordFromPage2",myConnection);  
  myDataAdapter.SelectCommand.CommandType   =   CommandType.StoredProcedure;  
   
  myDataAdapter.SelectCommand.Parameters.Add("@sqlstr",sqlstr);  
  myDataAdapter.SelectCommand.Parameters.Add("@pagecount",pagecount);  
  myDataAdapter.SelectCommand.Parameters.Add("@pagesize",pagesize);  
   
  DataSet   ds   =   new   DataSet();  
  myDataAdapter.Fill(ds);  
  return   ds;  
   
  ds.Tables[0],ds.Tables[1],ds.Tables[2],分别对应三个l果?br />


asp 下:

<%   set   cmm=server.createobject("adodb.command")  
  set   rs=server.createobject("adodb.recordset")  
   
  cmm.commandtype=4  
  cmm.activeconnection=conn  
  cmm.commandtext="proc_name"  
  set   rs=cmm.execute  
  cmm.execute   %>  
   
      <%   while   not   rs.eof    
  response.write   rs(0)  
   
    rs.movenext  
      wend  
      %>  
      <%    
      set   rs2=rs.NextRecordset()  
      while   not   rs2.eof    
  response.write   rs2(0)  
              rs2.movenext  
      wend  
  ...........  
      rs2.close  
      set   rs2=nothing   %>


]]>
Enterprise Library 企业库笔?/title><link>http://m.tkk7.com/kiant/articles/289017.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Thu, 30 Jul 2009 02:25:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/289017.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/289017.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/289017.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/289017.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/289017.html</trackback:ping><description><![CDATA[<p>L安装 企业库和 MySQLq接</p> <p> </p> <p><strong>1.</strong><br /> Enterprise Library启用{֐后发?PublicKeyToken错误QHRESULT:0x80131040解决<br /> http://blog.csdn.net/cnming/archive/2007/07/15/1691714.aspx</p> <p>ps:我的解决Ҏ PublicKeyToken=null, 不设|秘?/p> <p> </p> <p><strong>2.Ҏ据库操作</strong></p> <p>http://pw.cnblogs.com/archive/2006/06/02/415431.html </p> <p> </p> <p><strong>3.</strong><br /> Microsoft.Practices.ObjectBuilder2.BuildFailedException: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, HRPConnection]) failed: 找不到请求的 .Net Framework 数据提供E序。可能没有安装?(Strategy type ConfiguredObjectStrategy, index 2) ---> System.ArgumentException: 找不到请求的 .Net Framework 数据提供E序。可能没有安装?/p> <p><br /> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" /><br /> 改ؓ(参见: x:\EntLib41Src\Quick Starts\Data\CS\DataAccessQuickStart\app.config CZ)<br /> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" /><br /> =======================================================<br /> 或者说最大的可能是没有相应的数据库链接驱?br /> 比如: 我的目中用的?mysql 配置文g?providerName="System.Data.SqlClient"<br /> 如果没有装相应的驱动 mysql-connector-net-6.0.3.zip有可能报这个错?</p> <p> </p> <p><strong>4. 数据库连?"未将对象引用到实? ?/strong><br /> 在家里机器上 "数据q接--MySQL Database--Server Name" 一栏填上本?IP地址 "10.0.0.99" 会提C错误信?"未将对象引用到实?, 改ؓ "localhost" 可? 但是在公司机器上却没q个问题. <br /> (N是因为公怸机有提供 mysql服务, 所以直接连接主成功.<br /> 而个人家里面用的是精? 没安装服? 所以直接打 IP地址是连接不? 需改ؓ localhost)</p> <p><br /> <strong>5. 步骤</strong><br /> 使用microsoft EnterpriseLibraryq接不同数据库简单应?<br /> 文章出处Qhttp://www.diybl.com/course/4_webprogram/asp.net/netjs/20081216/154074.html</p> <p> </p> <p> </p> <img src ="http://m.tkk7.com/kiant/aggbug/289017.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2009-07-30 10:25 <a href="http://m.tkk7.com/kiant/articles/289017.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>C# XML的一点记?/title><link>http://m.tkk7.com/kiant/articles/289010.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Thu, 30 Jul 2009 02:11:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/289010.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/289010.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/289010.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/289010.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/289010.html</trackback:ping><description><![CDATA[<br /> C#dXMLҎ<br /> http://www.cnblogs.com/sopper/archive/2006/11/03/549435.html <br /> <br /> <br /> <hr /> <p><br />         XmlDocument doc = new XmlDocument();<br />         XmlElement root = doc.CreateElement("root");</p> <p>        XmlElement companyId = doc.CreateElement("companyId");<br />         companyId.InnerText = "1";<br />         root.AppendChild(companyId);</p> <p>        doc.AppendChild(root);<br />         string kk = doc.OuterXml;<br /> <br /> <br /> </p> <p>///////////////////////////<br /> <p>try<br />             {<br />                 XmlDocument doc = new XmlDocument();<br />                 XmlElement root = doc.CreateElement("root");<br />                 foreach (var item in dict)<br />                 {<br />                     XmlElement e = doc.CreateElement(item.Key);<br />                     e.InnerText = item.Value;<br />                     root.AppendChild(e);<br />                 }</p> <p>                doc.AppendChild(root);<br />                 return doc.OuterXml;<br />             }<br />             catch (Exception)<br />             {<br />                 return "";<br />             }</p> <p><br /> <br /> <br /> <hr /> <strong>?/strong><br /> <br />         XDocument doc = new XDocument(<br />             new XDeclaration("1.0", "utf-8", "yes"),<br />             new XElement("root",<br />                 new XElement("companyId", "1")<br />             )<br />         ); <p> </p> <p>        string kk = doc.ToString();<br /> <br /> ---------<br />         XDocument doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));<br />         XElement root = new XElement("root");</p> <p>        XElement element = new XElement("companyId");<br />         element.Value = 1 + "";<br />         root.Add(element);</p> <p>        doc.Add(root);</p> <p><br /> <hr /> <strong>元素d</strong><br /> <br />         XElement els = XElement.Parse(msg);<br />         var companyId = from e in els.Elements("companyId")<br />                         select e;<br />         string kk = companyId.First().Value;<br /> <br /> <p> </p> <img src ="http://m.tkk7.com/kiant/aggbug/289010.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2009-07-30 10:11 <a href="http://m.tkk7.com/kiant/articles/289010.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Xml 处理c?更新?..)http://m.tkk7.com/kiant/articles/286878.html黄小?/dc:creator>黄小?/author>Wed, 15 Jul 2009 07:09:00 GMThttp://m.tkk7.com/kiant/articles/286878.htmlhttp://m.tkk7.com/kiant/comments/286878.htmlhttp://m.tkk7.com/kiant/articles/286878.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/286878.htmlhttp://m.tkk7.com/kiant/services/trackbacks/286878.html阅读全文

]]>
C# 定时器用一?/title><link>http://m.tkk7.com/kiant/articles/282489.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Mon, 15 Jun 2009 16:11:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/282489.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/282489.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/282489.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/282489.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/282489.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">using</span><span style="color: #000000"> System;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Collections.Generic;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Linq;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">using</span><span style="color: #000000"> System.Text;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">namespace</span><span style="color: #000000"> ConsoleApplication1<br /> <img id="Codehighlighter1_117_1225_Open_Image" onclick="this.style.display='none'; Codehighlighter1_117_1225_Open_Text.style.display='none'; Codehighlighter1_117_1225_Closed_Image.style.display='inline'; Codehighlighter1_117_1225_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_117_1225_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_117_1225_Closed_Text.style.display='none'; Codehighlighter1_117_1225_Open_Image.style.display='inline'; Codehighlighter1_117_1225_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_117_1225_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_117_1225_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">class</span><span style="color: #000000"> Program<br /> <img id="Codehighlighter1_141_688_Open_Image" onclick="this.style.display='none'; Codehighlighter1_141_688_Open_Text.style.display='none'; Codehighlighter1_141_688_Closed_Image.style.display='inline'; Codehighlighter1_141_688_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_141_688_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_141_688_Closed_Text.style.display='none'; Codehighlighter1_141_688_Open_Image.style.display='inline'; Codehighlighter1_141_688_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_141_688_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_141_688_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> Main(</span><span style="color: #0000ff">string</span><span style="color: #000000">[] args)<br /> <img id="Codehighlighter1_191_682_Open_Image" onclick="this.style.display='none'; Codehighlighter1_191_682_Open_Text.style.display='none'; Codehighlighter1_191_682_Closed_Image.style.display='inline'; Codehighlighter1_191_682_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_191_682_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_191_682_Closed_Text.style.display='none'; Codehighlighter1_191_682_Open_Image.style.display='inline'; Codehighlighter1_191_682_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_191_682_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_191_682_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            AddRoomTimer timer </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> AddRoomTimer();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">while</span><span style="color: #000000"> (</span><span style="color: #0000ff">true</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_283_510_Open_Image" onclick="this.style.display='none'; Codehighlighter1_283_510_Open_Text.style.display='none'; Codehighlighter1_283_510_Closed_Image.style.display='inline'; Codehighlighter1_283_510_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_283_510_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_283_510_Closed_Text.style.display='none'; Codehighlighter1_283_510_Open_Image.style.display='inline'; Codehighlighter1_283_510_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span id="Codehighlighter1_283_510_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_283_510_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">if</span><span style="color: #000000"> (AddRoomTimer.COUNT </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_345_496_Open_Image" onclick="this.style.display='none'; Codehighlighter1_345_496_Open_Text.style.display='none'; Codehighlighter1_345_496_Closed_Image.style.display='inline'; Codehighlighter1_345_496_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_345_496_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_345_496_Closed_Text.style.display='none'; Codehighlighter1_345_496_Open_Image.style.display='inline'; Codehighlighter1_345_496_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span id="Codehighlighter1_345_496_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_345_496_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    Console.WriteLine(</span><span style="color: #0000ff">string</span><span style="color: #000000">.Format(</span><span style="color: #000000">"</span><span style="color: #000000">W{0}ơ调?/span><span style="color: #000000">"</span><span style="color: #000000">, </span><span style="color: #000000">101</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> AddRoomTimer.COUNT));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    AddRoomTimer.COUNT</span><span style="color: #000000">--</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /></span><span style="color: #000000">        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> AddRoomTimer<br /> <img id="Codehighlighter1_725_1223_Open_Image" onclick="this.style.display='none'; Codehighlighter1_725_1223_Open_Text.style.display='none'; Codehighlighter1_725_1223_Closed_Image.style.display='inline'; Codehighlighter1_725_1223_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_725_1223_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_725_1223_Closed_Text.style.display='none'; Codehighlighter1_725_1223_Open_Image.style.display='inline'; Codehighlighter1_725_1223_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_725_1223_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_725_1223_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">静态计数器变量</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> COUNT </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        public static System.Threading.Timer timer;<br /> <br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000">静态构? 最多运行一?/span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">static</span><span style="color: #000000"> AddRoomTimer()<br /> <img id="Codehighlighter1_844_1013_Open_Image" onclick="this.style.display='none'; Codehighlighter1_844_1013_Open_Text.style.display='none'; Codehighlighter1_844_1013_Closed_Image.style.display='inline'; Codehighlighter1_844_1013_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_844_1013_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_844_1013_Closed_Text.style.display='none'; Codehighlighter1_844_1013_Open_Image.style.display='inline'; Codehighlighter1_844_1013_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_844_1013_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_844_1013_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">多线E定时器, 每隔 10000毫秒调用一ơ被委托的方?nbsp;TimerCallBack</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            timer </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> System.Threading.Timer(TimerCallBack, </span><span style="color: #0000ff">null</span><span style="color: #000000">, </span><span style="color: #000000">0</span><span style="color: #000000">, </span><span style="color: #000000">10000</span><span style="color: #000000">);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> TimerCallBack(</span><span style="color: #0000ff">object</span><span style="color: #000000"> obj)<br /> <img id="Codehighlighter1_1078_1217_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1078_1217_Open_Text.style.display='none'; Codehighlighter1_1078_1217_Closed_Image.style.display='inline'; Codehighlighter1_1078_1217_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1078_1217_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1078_1217_Closed_Text.style.display='none'; Codehighlighter1_1078_1217_Open_Image.style.display='inline'; Codehighlighter1_1078_1217_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span id="Codehighlighter1_1078_1217_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1078_1217_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">打印一ơ时? 试?/span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            Console.WriteLine(DateTime.Now.ToString());<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #008000">//</span><span style="color: #008000">计数器变量重|?/span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">            COUNT </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <img src ="http://m.tkk7.com/kiant/aggbug/282489.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2009-06-16 00:11 <a href="http://m.tkk7.com/kiant/articles/282489.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Connector/Net q接 MySQLq程服务器出?"Unable to connect to any of the specified MySQL hosts" 解决Ҏhttp://m.tkk7.com/kiant/articles/270714.html黄小?/dc:creator>黄小?/author>Thu, 14 May 2009 13:32:00 GMThttp://m.tkk7.com/kiant/articles/270714.htmlhttp://m.tkk7.com/kiant/comments/270714.htmlhttp://m.tkk7.com/kiant/articles/270714.html#Feedback2http://m.tkk7.com/kiant/comments/commentRss/270714.htmlhttp://m.tkk7.com/kiant/services/trackbacks/270714.html
今天做项目时候就遇到q问?br /> 中文提示“找不到相应的L?#8221;

q时候请查数据库服务器上 MySql.Data.dll 文g版本和项?bin 目录下的版本是否一致?/p>

如果q程L版本?6.0.3
而项目引用的?5.0.3
则会出现以上的错误提C?/p>

但是如果本机L上版本是 6.0.3
即ə目引用的是 5.0.3
也能正常q接数据库,不清楚是什么原?/p>

]]>
关于 WinForm ?DataGridView , TreeView 的一点记?/title><link>http://m.tkk7.com/kiant/articles/270124.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Mon, 11 May 2009 14:38:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/270124.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/270124.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/270124.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/270124.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/270124.html</trackback:ping><description><![CDATA[     摘要: 一、编E方式修改被l定的数据对?nbsp;        //利用 DataBindingComplete 在数据绑定操作完成之后发?        private void dataGridView1...  <a href='http://m.tkk7.com/kiant/articles/270124.html'>阅读全文</a><img src ="http://m.tkk7.com/kiant/aggbug/270124.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2009-05-11 22:38 <a href="http://m.tkk7.com/kiant/articles/270124.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asp.net 目的一Ҏȝ 点卡销?CRM http://m.tkk7.com/kiant/articles/250980.html黄小?/dc:creator>黄小?/author>Mon, 12 Jan 2009 07:35:00 GMThttp://m.tkk7.com/kiant/articles/250980.htmlhttp://m.tkk7.com/kiant/comments/250980.htmlhttp://m.tkk7.com/kiant/articles/250980.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/250980.htmlhttp://m.tkk7.com/kiant/services/trackbacks/250980.html

 遇到问题与解军_?br />
1、出错一ơ之?linq 不自动释? 然后老是提示插入已经存在的实?br />


2?个层相连?中间的细UK?br />
<div><img alt="登陆" height="26" src="images/login.gif" /></div>

div 高度Ҏ内容自适应问题

height:100%


css中如何div居中(垂直水^居中)
http://www.7say.com/article.asp?id=184


3、FileUpload ?提交面板冲突
commandName ?回传判断冲H?nbsp; Q需在回传的时候在一ơ绑?Gv数据源,comman事g才v作用Q?br />


4、用 Response.Write("") 传输脚本<script>文g 会媄响CSS架构
            ScriptManager.RegisterStartupScript(this.butInsert, this.GetType(), "ok",
                "alert('增加成功');", true);


5、自动刷新页?br />
   <script language=javascript>window.location.href=document.URL;
    </script>" );

 Response.AddHeader( "Refresh","0" );
Response.Redirect( Request.Url.ToString( ) );


6、My97DatePicker 日历插g
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>

 onFocus="new WdatePicker(this,'%Y-%M-%D %h:%m:%s',true,'default')"



7、LINQ 修改一个实体的外键 需用到的表辑ּQ奇怪的 ORM思想表现方式Q?br /> Lambda 用在ZҎ?LINQ 查询中,作ؓ诸如 Where ?Where {标准查询运符Ҏ的参数?
old.xxx = db.RoleInfo.Single(p => p.RoleId == (int)RoleInfoType.񔽎理?;

linq to sql 怎么修改有外键约束的?br /> http://forums.microsoft.com/china/ShowPost.aspx?PostID=4084266&SiteID=15

新Orcas语言Ҏ:Lambda表达?br /> http://blog.joycode.com/scottgu/archive/2007/04/09/100744.aspx

Lambda 表达式(C# ~程指南Q?br /> http://msdn.microsoft.com/zh-cn/library/bb397687.aspx



8、Asp.Net 的用户凭?br /> string strRedirect = Request.QueryString["ReturnUrl"];
System.Web.Security.FormsAuthentication.SetAuthCookie(instance.RoleInfo.RoleName, true);
if (strRedirect != null)
   Response.Redirect(strRedirect);


        System.Web.Security.FormsAuthentication.SignOut();
        Response.Redirect("~/Default.aspx");


    <authentication mode="Forms">
      <forms loginUrl="~/Default.aspx" timeout="60"></forms>     
    </authentication>


<system.web>
      <authorization>
            <allow users="񔽎理?VIP会员,普通会?/>
        <deny users="*"/>
      </authorization>
    </system.web>

ASP .NET 中的w䆾验证Q?NET 安全性指?br /> http://www.iwms.net/n809c12.aspx




9、关于枚?Enum
    定义枚D时候直接用中文,然后可以利用枚D静态方法读取枚举中文名    Enum.GetName(typeof(XXXXType), (int)objVaule)  ?? 
    如果要考虑到多语言话的问题  使用数据库存?br />


10.合ƈ单元?br />
TableCell[] tempCells = new TableCell[gv.Rows[0].Cells.Count - 1];


        //遍历?br />         for (int r = 0; r < gv.Rows.Count; r++)
        {
            //行内遍历单元?br />             for (int i = 0; i < tempCells.Length; i++)
            {
                if (tempCells[i] != null && gv.Rows[r].Cells[i].Text.Equals(tempCells[i].Text))
                {
                    tempCells[i].RowSpan++;
                    gv.Rows[r].Cells[i].Visible = false;
                }
                else
                {
                    tempCells[i] = gv.Rows[r].Cells[i];
                    tempCells[i].RowSpan = 1;
                }
            }
        }


11、Linq 的分讨?br /> http://www.cnblogs.com/9527/archive/2007/07/05/807451.html

DLINQ(LINQ to SQL)之大数据量分cgq执行和日志记录
http://www.mikecat.net/showtopic-36.aspx

VS2008的LinqQ更新数据就那么费劲Q?br /> http://dev.yesky.com/msdn/319/3499319.shtml

LINQ体验(9)——LINQ to SQL语句之Insert/Update/Delete操作
http://www.cnblogs.com/lyj/archive/2008/01/28/1056133.html




12、JS 模式H口
举例讲解returnValue的含?br /> http://dev.csdn.net/develop/article/47/47565.shtm

利用AJAX实现 web面的模式对话框
http://www.javaeye.com/topic/39062

CZQ签名栏囄展示Ҏ
http://bbs.duowan.com/viewthread.php?tid=12573003###




13、XML文g的写入权?nbsp;  需手动指定权限
sys.WebForms.PageRequestManagerServerErrorException:错误原因





]]>
二、ASP.NET 服务器控?草本)http://m.tkk7.com/kiant/articles/239108.html黄小?/dc:creator>黄小?/author>Thu, 06 Nov 2008 12:34:00 GMThttp://m.tkk7.com/kiant/articles/239108.htmlhttp://m.tkk7.com/kiant/comments/239108.htmlhttp://m.tkk7.com/kiant/articles/239108.html#Feedback0http://m.tkk7.com/kiant/comments/commentRss/239108.htmlhttp://m.tkk7.com/kiant/services/trackbacks/239108.html 二、ASP.NET 服务器控?br />


可以d?ASP.NET 面上的控g有三U类型:
    ?HTML 服务器控Ӟ也就?HTML 标签Q位?System.Web.UI.HtmlControls 命名I间?br />     ?Web 服务器控Ӟ提供l一的编E模型、包含方法以及现关的旉处理E序Qƈ且代码都在服务器端执行。位?System.Web.UI.WebControls 命名I间中?br />     ?定制控g和用hӞ由开发h员定制的控g?br />
    我们d的所有服务器控g都会自动成ؓ对象模型的一部分Q该对象模型是在q段后置代码中ؓH体构徏的。基本上QWeb H体上控件的状态信息(包括文本框中的输入数据、下拉列表中的选项{)存储在隐藏的 viewstate 字段中,q个字段是服务器生成面的一部分Qƈ传送给用户。在复杂的窗体上Q会产生很多?viewstate |可以用不需保留状态信息的控g ViewstateQ也可以用整个面?ViewstateQ有助于提高性能?br />
    修改q的 .aspx.cs 文g可以不用再次手工~译Q就可以昄其改变的信息(?)?br />


一、Crystal ReportsQCrystal 报表服务器控Ӟ
    可以?Web 面上显C?Crystal 报表信息?br />


二、StandardQ标?Web 服务器控Ӟ
LabelQ显C简单文本,使用 Text 属性设|和~程修改昄的文本?br />
TextBoxQ提供一个用户可以编辑的文本框,支持 AutoPostBack 属性在修改文本内容后自动回送;支持 TextChanged 事g?br />
ButtonQ用户单ȝ标准按钮。支?Click 事gQ支?Command 事g讉K接收的附加属?CommandName ?CommandArgument?br />    
LinkButtonQ与 Button 相同Q但把按钮显CZؓ链接?br />
ImageButtonQ显CZ个图像,其属性和事gl承?Button ?Image?br />
HyperLinkQ添加一?HTML 链接,NavigateUrl 属性设|超链接QImageUrl 属性指定替换文本的囄QTarget 属性指定打开H口方式?br />
DropDownListQ允许用户选择一个列表项Q用属?Items 讄列表目Q一?ListItem 集合Q;SelectedItem ?SelectedIndex 属性确定选择的内容;支持 SelectedIndexChanged 事g可以用于定选项是否改变Q支?AutoPostBack 属性?br />
ListBoxQ允许用户选择一个或多个列表。把 SelectionMode 讄?Muliple ?Single 可以定一ơ选择多少选项QRows 定要显C选项个数Q其他选项?DropDownList 控g相同?br />
CheckBoxQ显CZ个复选框Q选择的状态在 Checkted 属性中Q文本在 Text 属性;支持 AutoPostBack 属性;支持 CheckedChanged 事g?br />
CheckBoxListQ创Zl复选框Q属性和事g可参?DropDownList?br />
RadioButtonQ显CZ个单选按钮,使用 GroupName 属性可以把 RadioButton 控g链接C个组中,其他属性与事g?CheckBox 相同?br />
RadioButtonListQ创Zl单选按钮,其属性与事gcd于其他列表控件?br />
ImageQ显CZ个图像。?ImageUrl q行囑փ索引Q如果图像加载失败则昄 AlternateText 对应的文本?br />
ImageMapQ类g ImageQ但支持 HotSpot 控g提供的热区功能重定向C同的面?br />
TableQ指定一个表Q可讑֮ TableRow ?TableCellQ或?TableRow 的集合类属性指定数据行?br />
BulletedListQ把一个选项列表格式化ؓ一个项目符号列表,可以有不同的昄格式Q支?Click 事g定用户回送的选项Q?lt;ol>...</ul>Q?lt;ul>...</ul>?br />
HiddenFieldQ用于提供隐藏的字段Q以存储不同的倹{这个控件可存储需要另一U存储机制才能发挥作用的讄。?Value 属性访问存储的倹{?br />
LiteralQ执行与 Label 相同的功能,但没有样式属性,只有一?Text 属性?br />
CalendarQ允许用户从囑փ日历中选择一个日期。基本功能是 SelectedDate ?VisibleDate 属性?br />
AdRotatorQ广告流转板Q顺序显C几个图像,使用 AdvertisementFile 属性指定描q图像的 XML 文gQ支?AdCreated 事g?br />
FileUploadQ提供用户选择q上传文Ӟ支持 HasFile 属性,支持后台代码?SaveAs() Ҏ执行文g上传?br />
WizardQ用L化用户在几个面中输入数据的常见dQ可以给向导d多个步骤Q按序或不按顺序显C,q依赖此控g来维护状态?br />
XmlQ复杂的文本昄控gQ用于显C用 XSLT 样式传输?XML 内容?br />
MultiViewQ包含一个或多个 View 控gQ每ơ只昄一?View 控g。可?ActiveViewIndex 属性指定当前;如果视图改变会触?ActiveViewChanged 事g?br /> PanelQ添加其他控件的容器。可以?HorizontalAlign ?Wiap 指定内容如何安排?br />
ViewQ控件的容器Q类g PlaceHolderQ但主要作用?MulitView 的子控gQ支?Activate ?Deactivate 事g激zȝ态的变化?br />


SubstitutionQ指定一l不与其他输Z起高速缓存的 Web 面?br />
LocationQ与 Literal 相同Q但允许使用目资源指定要在不同区域昄的文本,使文本本地化?br />


三、DataQ数?Web 服务器控Ӟ
  数据 Web 服务器控件分Zc:
    ?数据源控Ӟ实现从不同数据源获取数据的功能,最好通过囑Ş化的向导来配|属性。分Zc:
System.Web.UI.DataSourceQ普通数据源控gQ?br />
ObjectDataSourceQ可以处理存储在自己创徏的对象中的数据,能在 ASP.NET 中快hC定制的对象模型?br />
SqlDataSourceQ用和操作 SQL Server 数据库中存储的数据管道,q回的对象是 DataSet?br />
AccessDataSourceQ用和操作 Access 数据库中存储的数据管道?br />

System.Web.UI.HierarchicalDataSourceQ层ơ化数据源控Ӟ
XmlDataSourceQ处理层ơ结构化的数据,可以l定D控gQ还可以使用 XSL 样式表传?XML 数据?br />
SiteMapDataSourceQ可以绑定到层次站点地图数据上?br />

   
    ?数据昄控g

GridViewQ以数据行的格式昄多个数据(例如数据库中的行Q,利用q个控g的属性,可以选择、排序和~辑数据V?br />
DataListQ显C多个数据项Q可以ؓ每一Ҏ供模板,以Q意指定的方式昄数据字段Q可以选择、排序和~辑数据V?br />
DetailsViewQ显C单条数据项的详l字D,可以d、编辑和删除数据V?br />
FormViewQ用模板显CZ个数据项Q可以添加、编辑和删除数据V?br />
RepeaterQ类g DataListQ但是不能选择和编辑数据?br />
RepeaterViewerQ显C报表服务数据的高控g?br />


四、ValidationQ验?Web 服务器控Ӟ
    验证控g可以在不~写代码的前提下验证用户输入Q还可以自动l用戯出有帮助的提C,甚至q可以生成客L?JavaScript 函数来简化验证Q务的执行?br />
    验证控g只要有回送,每个验证控g׃查控件是否有效,q相应地改变 IsValid 属性的倹{如果页面中M一个有效性验证控件不通过验证Q那整个面?IsValid 属性ؓ false。另外,存储?ErrorMessage 中的文本可以在验证控件所在位|输出(Display 属性)Q也可以和其他页面上的验证控件一赯出在一个独立的位置Q?ValidationSummary 控gQ。ControlToValidate 属性用于指定要验证的控件的~程ID?br />
RequiredFieldValidatorQ对输入控g的非I验证?br />
CompareValidatorQ检查输入的数据是否满单的要求。利用一个运集合,通过 Operator ?ValueToCompare 属性进行验证。Operator 讄比较q算W?>?lt;? Q?ValueToCompare 用于比较的|q有 Type 用于讄比较的类型;最后还是对另一控gq行比较 ControlToCompare 属性?br />
RangeValidatorQ验证输入数?MaximumValue ?MinimumValue 间的范围QType 指定光证的数据cd?br />
RegularExpressionValidatorQ根据存储在 ValidationExpression 中的正则表达式验证字D늚内容?br />
CustomValidatorQ用定制函数验证控件的数据Q自定义验证。ClientValidationFunction 用户讄客户端验证的脚本函数QServerValidate 事g指定服务器验证数据的Ҏ?br />
ValidationSummaryQؓ所有设|了 ErrorMessage 的验证控件显C验证错误。通过 DisplayMode ?HeaderText 属性其显C的内容可以格式化;ShowSummary 属性设|是否显C;ShowMessageBox 属性设|是否弹出对话框昄信息?br />

五、Navigation Q导?Web 服务器控Ӟ

SiteMapPathQ显C\径样式的信息Q允许用户看他们在站点l构中的位置QƈD到父区域中?br />
MenuQ支持静态或动态样式的菜单D站点?br />
TreeViewQ可以在树Şl构中显C层ơ化数据。树中的节点存储?Nodes 属性中Q选中的节点存储在 SelectedNode 中,支持 SelectedNodeChanged ?TreeNodeCollapsed 事g?br />
    根目录下的站点地?Web.sitemap XML 文g包含一?lt;siteMap>元素Q这个跟元素包含一?lt;siteMapNode>元素Q?lt;siteMapNode>元素可以包含多个嵌套?lt;siteMapNode>元素。每个跟元素都包含下列属?title、url、roles、description 属性?br />
    d控g时将使用默认的提供程序和当前?URL 位置Q格式化爉面的链接列表。如果用定制的提供E序Q可以通过 SiteMapProvider 属性指定提供程序IDQ还可以使用 StartingNodeOffset 删除菜单数据的上一层(例如根?Home )Q?#8220;数据源控?#8221;?ShowStartingNode 属性选定是否删除链接Q?StartFromCurrentNode 属性指定是否从当前位置开始;使用 StringNodeUrl 会重写根节点?br /> 地图

    默认提供E序会忽?roles 属性,q种定制在 Web.config 文g?securityTrimmingEnable 属性设|ؓ当前用户允许查看的节Ҏ供数据,q种可见性是qL角色成员军_的?br />
























]]>
ASP.NET W记Q一Q、概q?/title><link>http://m.tkk7.com/kiant/articles/237918.html</link><dc:creator>黄小?/dc:creator><author>黄小?/author><pubDate>Fri, 31 Oct 2008 15:16:00 GMT</pubDate><guid>http://m.tkk7.com/kiant/articles/237918.html</guid><wfw:comment>http://m.tkk7.com/kiant/comments/237918.html</wfw:comment><comments>http://m.tkk7.com/kiant/articles/237918.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/kiant/comments/commentRss/237918.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/kiant/services/trackbacks/237918.html</trackback:ping><description><![CDATA[<br /> <br /> <strong><span style="font-size: 14pt;"> 一、概q?/span></strong><br />     ASP.NET 提供了完整的服务器端对象模型Q可以在q行期间使用。ASP.NET 可以在其环境中把面上的所有控件作为对象来讉K。在面上用控件功能,生成 HTML 内容?ASP.NET 通常UCؓ Web H体?br /> <br />     基本上,Web H体上控件的状态信息(包括在文本框中输入的信息、下拉列表中的选项{)存储在隐藏的 viewstate 字段中,q个字段是服务器生成的页面的一部分Qƈ传送给用户。后l的操作UCؓ会送(postbackQ?br /> <br /> <br /> <br /> <strong><span style="font-size: 14pt;"> 二、ASP.NET    Web H体</span></strong><br />   ?保留文g?App_DateQ包含数据文Ӟ例如 XML文g或数据库文g?br />   ??ASP.NET 面中,只有一个服务器?lt;form>元素?br />   ?runat="server" 表示H体的处理将在服务器上进行,必须具备Q否则窗体不会执行Q何操作?br />   ?剙?<@% Page %> 标记Q定义了面Ҏ?br /> <br /> <br /> <strong> 2.1、流E?/strong><br />   .aspx     布局(HTML)和ASP.NET 代码?br />   .aspx.cs    用于定制H体操作的代码?br /> <br /> 预编译站ҎE:<br />     ?ASP.NET 处理器执行页面,定对象创徏Q以实例化页面对象模型?br />     ?动态创Z个基c,包括面上的控g成员和这件控件的事g处理E序Q例如按钮单MӞ?br />     ?面代码文g与这个基cdqӞ构成完整的对象模型?br />     ?~译所有代码,q告诉缓存v来?br />     ?生成 HTMLQ返回给用户?br /> <br /> <br /> <strong>2.2、ASP.NET 中常见的pȝ对象</strong><br />   <br /> Page 对象Q页面自w的方式?br /> <br /> Request 对象Q封装了由客L生成?HTTP h的细节(参数、属性和数据Q?br />     ?QueryStrings 属性收集了 Get h发送的数据?br />     ?From 属性收集了 Post h发送的数据?br />     ?ServerVariableQ环境变量)集合中包含服务器和客L的系l信息。在 Page 指o里添加属?Trace="True" 可以q踪详细的环境变量信息?br />     ?Params 集合包含了上三种方式的集合?br /> <br /> Response 对象Q响应返回到 HTTP 客户端的输出?br />     ?Write() Ҏ可以输出指定的文本内宏V?br />     ?End() Ҏ可以?Web 服务器停止当前的E序q返回结果?br />     ?Redirect() Ҏ可以页面重定向到另一面?br /> <br /> Session 对象Q作用于会话期的面׃n信息?br />     Session["xxxx"] = 值对?<br />     对象 = Session["xxxx"];<br /> <br /> Cookie 对象Q保持与客户端的׃n信息方式。对应于 HttpCookie cR?br />     Response.Cookies["xxxx"].Value = 字符串变?<br />     string xxx = Request.Cookies["xxx"].Value;<br />     <br /> Application 对象Q作用于应用E序q行期提供共享信息?br />     Application["xxxx"] = 值对?<br />     值变?= Application["xxxx"];<br /> <br /> Server 对象Q只是封装了一?Web 服务器相关的常用Ҏ?br />     Server.MapPath("~/");        //q回所在虚拟目录的物理路径<br />     Server.HtmlEncode("xxxx");        //不编?HTML 代码Q直接在面输出<br />     Server.Encode("xxxxx");        //?URL 地址的特D字W进行编?br />     Server.Execute("xxxxx");        //执行参数指定的页面,执行完后q回本页<br />     Server.Transfer("xxxx");        //执行参数指定的页面,执行完后l束<br /> <br /> <br /> <br /> <strong><span style="font-size: 14pt;">三、应用程序配|?/span></strong><br />     应用E序定义为项目中的所有文Ӟ?Web.config 文g配置?br /> <br />     W一ơ创建应用程序(x到第一?HTTP hӞQ将创徏 Application 对象。此时还触?Application_Start 事gQ创Z?HttpApplication 实例池。每个输入的h都会接收到这样一个实例,执行h的处理过E。与全局?Application 对象不同Q所有的 HttpApplication 实例完成d后,p?Application_End 事gQ应用程序终止运行,消除 Application 对象?br /> <br />     在单个用户?Web 应用E序Ӟ会启动一个会话,与应用程序类|会话创Z个用L定的 Session 对象Qƈ触发 Session_Start 事g。在一个会话中Q每个请求都触?Application_BeginRequest ?Application_EndRequest 事g。在一个会话中可以多次触发q两个事件访问应用程序的不同资源。会话可以手动终止,也可以因为没有后l请求而超时终止。会话种子会触发 Session_End 事gQ消?Session 对象?br /> <br /> <br /> <br /> <img src ="http://m.tkk7.com/kiant/aggbug/237918.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/kiant/" target="_blank">黄小?/a> 2008-10-31 23:16 <a href="http://m.tkk7.com/kiant/articles/237918.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> վ֩ģ壺 <a href="http://24aabb.com" target="_blank">91ѹۿ</a>| <a href="http://www12kvkv.com" target="_blank">ŷպ</a>| <a href="http://9522952.com" target="_blank">η츾AAAAƬѿ</a>| <a href="http://by33321.com" target="_blank">Ʒɫ99þþƷ</a>| <a href="http://ttays.com" target="_blank">˳վۿ</a>| <a href="http://wwwayx2026.com" target="_blank">ˬˬձƵ</a>| <a href="http://lyaa17.com" target="_blank">2019Ļȫ</a>| <a href="http://9ts9.com" target="_blank">һ߹ۿ</a>| <a href="http://zhaosaohuo.com" target="_blank">ۺϾƷ</a>| <a href="http://qingdaostf.com" target="_blank">СƵ߹ۿ</a>| <a href="http://5656ys.com" target="_blank">þþþƷ޳18վ</a>| <a href="http://600c28.com" target="_blank">ֱѹۿ</a>| <a href="http://35469642.com" target="_blank">aëƬѹۿƵ</a>| <a href="http://jpvv8.com" target="_blank">ݾ߹ۿվ</a>| <a href="http://aidannis.com" target="_blank">˽ۺϾþ</a>| <a href="http://5916733.com" target="_blank">͵ͼƬ</a>| <a href="http://zgdhuibao.com" target="_blank">ɫվwwwվ </a>| <a href="http://www96008.com" target="_blank">avttֻ</a>| <a href="http://www-091w.com" target="_blank">ͬ˧GAYƬ߹ۿ</a>| <a href="http://35419470.com" target="_blank">AVһ</a>| <a href="http://fuhui123.com" target="_blank">Ļwww˳</a>| <a href="http://sswg2.com" target="_blank">ѴƬ߹ۿ</a>| <a href="http://179228.com" target="_blank">97ԭѹۿ</a>| <a href="http://xcdys.com" target="_blank">һ˿wwwƵ߹ۿ</a>| <a href="http://chaoxung.com" target="_blank">ҹƵ</a>| <a href="http://jj5c.com" target="_blank">ŮڵƵ</a>| <a href="http://565636.com" target="_blank">޹AVһ </a>| <a href="http://nmcytsi.com" target="_blank">avƬ߹ۿ</a>| <a href="http://www62hth.com" target="_blank">ۺƷ˿</a>| <a href="http://niutextile.com" target="_blank">ձþþþĻ</a>| <a href="http://0755host.com" target="_blank">þԭAV鶹</a>| <a href="http://lkzrgy.com" target="_blank">ŷ͵ҹɫ</a>| <a href="http://ddtase.com" target="_blank">Ʒxxxxˮ޹Ʒþһ </a>| <a href="http://wwwff113.com" target="_blank">ƷƵվ</a>| <a href="http://see01.com" target="_blank">߹ۿΪƵ</a>| <a href="http://pj9xx6.com" target="_blank">Ƶһ</a>| <a href="http://kj555888.com" target="_blank">ŮˬƵȫ</a>| <a href="http://imfakaixin.com" target="_blank">㻨ѸƵ</a>| <a href="http://54vpn.com" target="_blank">߹ۿ˳Ƶ</a>| <a href="http://dnf1000.com" target="_blank">þþƷһ糱 </a>| <a href="http://www-333346.com" target="_blank">޾ƷŮƵ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>