控制网站分辨率 我们可以 用 frameset
虽然 asp.net不支持这个属性 但是功能是可以实现的
如 :
<frameset name="main" rows="105,*" frameborder="no" border="0" framespacing="0">
<frame src="xx.aspx" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frame src="yy.htm" name="contentFrame" scrolling="No" noresize="noresize" id="contentFrame" title="contentFrame" />
</frameset>
<noframes><body>
</body>
</noframes>
此页面 没有body ......
在asp.net里面,很多时候使用session来保存一些对象,比如说购物车等等,有很多时候,就算你设置了session超时的时间,session还是会无缘无故的丢失,这里有一种比较简单的方法可以设置session丢失的时间。
在web.config里面如下配置
<sessionState
mode="StateServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="30000" stateNetworkTimeout="144000"
/>
其实这句话就是利用服务器来保存session,这样就不会丢失,当然,还要在服务器上进行配置。
我的电脑-->右键点管理-->点开服 ......
Asp.net 自动发送邮件的方法
今天有一个模块需要自动发送邮件的功能,就随便写了一个,记录一下作为积累。
一、首先需要配置web.config文件:
<system.net>
<mailSettings>
<smtp from="Emailname">
<network host="smtp.163.com" userName="Emailname" password="Emailpassword"
port="25" defaultCredentials="false"/>
</smtp>
</mailSettings>
</system.net>
二、然后编写发送邮件的函数:
//// <summary>
/// 邮件发送方法(带附件)
/// </summary>
/// <param name="mailto">收件人地址。如:receiver@163.com</param>
/// <param name="mailsubject">邮件标题</param>
/// <param name="mailbody">邮件正文</param>
/// <param name="mailfrom">邮件发送人地址。如:sender@163.com</param>
/// <param name="list">附件路径</param>
/// <returns></returns& ......
/// <summary>
/// 过滤标记
/// </summary>
/// <param name="NoHTML">包括HTML,脚本,数据库关键字,特殊字符的源码 </param>
/// <returns>已经去除标记后的文字</returns>
public static string NoHTML(string Htmlstring)
{
if (Htmlstring == null)
{
return "";
}
else
{
//删除脚本
Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase);
& ......
/// <summary>
/// 过滤标记
/// </summary>
/// <param name="NoHTML">包括HTML,脚本,数据库关键字,特殊字符的源码 </param>
/// <returns>已经去除标记后的文字</returns>
public static string NoHTML(string Htmlstring)
{
if (Htmlstring == null)
{
return "";
}
else
{
//删除脚本
Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase);
& ......
1.对IE浏览器进行设置
文件-〉页面设置-〉将里面的页眉和页脚的内容清空 就OK了
2.页面代码实现 Javascript
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><!-- startprint -->
//您要打印的部分;
<!-- endprint -->
<div><input tupe=botton name="Print" value="打印" onclick="prit()"</div>
//教本如下:
<script language="javascript">
function prit()
{ bdhtml=window.document.body.innerHtml;
&nb ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Timers;
using System.Data;
using System.Data.SqlClient;
namespace SMS_joke
{
/// <summary>
/// Global 的摘要说明。
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
protected void Application_Start(Object sender, EventArgs e)
{
SetTimer();
}
protected void Session_Start(Object sender, EventArgs e)
{
}
protected void Application_BeginRequest(Object sender, EventArgs e)
{
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
}
protected void Application_Error(Object sender, EventArgs e)
{
}
protected void Session_End(Object sender, ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Timers;
using System.Data;
using System.Data.SqlClient;
namespace SMS_joke
{
/// <summary>
/// Global 的摘要说明。
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
protected void Application_Start(Object sender, EventArgs e)
{
SetTimer();
}
protected void Session_Start(Object sender, EventArgs e)
{
}
protected void Application_BeginRequest(Object sender, EventArgs e)
{
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
}
protected void Application_Error(Object sender, EventArgs e)
{
}
protected void Session_End(Object sender, ......