易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : asp.net

asp.net 发送邮件

  几个月前,做用户注册模块要用到发送邮件功能,也碰到了些或大或小的问题,现在总结一下:
我先贴出发送邮件用到的代码:
public void SendEmail(string stremail, string content,string title)
{
MailMessage mm = new MailMessage();
mm.from = new MailAddress(公司邮箱);
mm.To.Add(stremail); //stremail为目标邮箱地址
mm.Subject = title; //邮件标题
mm.Body = content;
mm.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.126.com");
client.Credentials = new NetworkCredential(公司邮箱, 邮箱密码);//CredentialCache.DefaultNetworkCredentials;
try
{
client.Send(mm);
}
catch
{
//异常处理。。。
}
}
1,当初,我使用自己的126邮箱来发送邮件,在程序中,代码没变动。结果:总是失败。
网上查资料说是关闭了该项服务。只能使用02年以前注册的邮箱才可以。最终找到一个同事的邮箱用来发送邮件,
还是没改 ......

Explained: Forms Authentication in ASP.NET 2.0

原地址:
http://msdn.microsoft.com/en-us/library/aa480476.aspx
IIS Authentication
ASP.NET authentication is a two-step process. First, Internet Information Services (IIS) authenticates the user and creates a Windows token to represent the user. IIS determines the authentication mode that it should use for a particular application by looking at IIS metabase settings. If IIS is configured to use anonymous authentication, a token for the IUSR_MACHINE account is generated and used to represent the anonymous user. IIS-then passes the token to ASP.NET.
Second, ASP.NET performs its own authentication. The authentication method used is specified by the mode attribute of the authentication element. The following authentication configuration specifies that ASP.NET uses the FormsAuthenticationModule class:
Copy Code
<authentication mode="Forms" />

Note   Because forms authentication does not rely on IIS authentication, you should configure anonymous access for you ......

asp.net mvc ajax 外部js 异步递交 form的实现

页面文件类似:
<% using (Ajax.BeginForm("AjaxUpdate", 123, new AjaxOptions {
Confirm = "confirm str", LoadingElementId = "idLoading", UpdateTargetId
= "textEntered", OnSuccess = "validateForm" },new{id="idMyForm"}))
       { %>
       <%=Html.EditorFor(c=>c) %>
       <span id="textEntered">Nothing Entered
        Result
      </span>
    <% } %>
<input type="button" value="Client Click" onclick="ClientClick(event)" /><br />
    <script type="text/javascript">
        function ClientClick(event) {
            var form = document.getElementById(&quo ......

asp.net mvc ajax 外部js 异步递交 form的实现

页面文件类似:
<% using (Ajax.BeginForm("AjaxUpdate", 123, new AjaxOptions {
Confirm = "confirm str", LoadingElementId = "idLoading", UpdateTargetId
= "textEntered", OnSuccess = "validateForm" },new{id="idMyForm"}))
       { %>
       <%=Html.EditorFor(c=>c) %>
       <span id="textEntered">Nothing Entered
        Result
      </span>
    <% } %>
<input type="button" value="Client Click" onclick="ClientClick(event)" /><br />
    <script type="text/javascript">
        function ClientClick(event) {
            var form = document.getElementById(&quo ......

ASP.NET中将数据输出到Excel

在开发ISO文件管理系统的时候,曾经遇到过要将ASPX直接输出到EXCEL的需求,现将经验所得与大家分享。 其实,利用ASP.NET输出指定内容的WORD、EXCEL、TXT、HTM等类型的文档很容易的。主要分为三步来完成。
  一、定义文档类型、字符编码
Response.Clear(); 
Response.Buffer= true; 
Response.Charset="utf-8";
//下面这行很重要, attachment 参数表示作为附件下载,您可以改成 online在线打开
//filename=FileFlow.xls 指定输出文件的名称,注意其扩展名和指定文件类型相符,可以为:.doc || .xls || .txt ||.htm
Response.AppendHeader("Content-Disposition","attachment;filename=FileFlow.xls");
Response.ContentEncoding=System.Text.Encoding.GetEncoding("utf-8");
//Response.ContentType指定文件类型 可以为application/ms-excel || application/ms-word || application/ms-txt || application/ms-html || 或其他浏览器可直接支持文档
Response.ContentType = "application/ms-excel";
this.EnableViewState&n ......

Asp.Net性能优化

(一).选择会话状态存储方式
    在Webconfig文件配置:
    <sessionState mode="???" stateConnectionString="tcpip=127.0.0.1:42424"
         sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
      cookieless="false" timeout="20"/>
     
    Asp.net有三种方式存储会话状态信息:
    1. 存储在进程中: 属性mode = InProc
       特点:  具有最佳的性能,速度最快,但不能跨多台服务器存储共享.
 
    2. 存储在状态服务器中: 属性mode = "StateServer"
       特点:   当需要跨服务器维护用户会话信息时,使用此方法。
               但是信息存储在状态服务器上,一旦状态服务器出现故障,信息将丢失
   ......

asp.net技巧。。。

1.Asp.Net中几种相似的标记符号: <%=...%> <%#... %> <% %> <%@ %> 解释及用法
   答:  <%#... %>: 是在绑定控件DataBind()方法执行时被执行,用于数据绑定
          如: <%# Container.DataItem("tit") %>
        <%= %>: 在程序执行时被调用,可以显示后台变量值
          如: 
           *.aspx中: <%= aaa %>
           *.cs中:   protected string aaa="姓名";
        <% %>: 内联代码块里面可以在页面文件*.aspx或*.ascx文件里面嵌入后台代码
          如:
            <%
             for(int i=0;i< ......
总记录数:2672; 总页数:446; 每页6 条; 首页 上一页 [190] [191] [192] [193] 194 [195] [196] [197] [198] [199]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号