1.<asp:Button ID="btnSumbit" runat="server" UseSubmitBehavior="false" OnClientClick="this.value='Sumbit';this.disabled=true; " Text="Sumbit" OnClick="btnSumbit_Click" />
2.对“添加”、“提交”、“保存”、“更新”等按钮需要对数据库进行写操作的按钮,一定要在页面初始化时加载脚本,防止多次重复点击,例如:
protected void Page_Load(object sender, EventArgs e)
{
//.net1.1
Button1.Attributes.Add("onclick", "this.disabled=true;" + this.GetPostBackEventReference(this.Button1));
//.net 2.0以上
Button1.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(Button1, ""));
}
为了测试,我们可以建立一个页面, ......
using System.Security.Cryptography;
using System.IO;
using System.text;
/// <summary>
/// 加密
/// </summary>
/// <param name="str"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string Encode(string str, string key)
{
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
provider.Key = Encoding.ASCII.GetBytes(key.Substring(0, 8));
prov ......
using System.Security.Cryptography;
using System.IO;
using System.text;
/// <summary>
/// 加密
/// </summary>
/// <param name="str"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string Encode(string str, string key)
{
DESCryptoServiceProvider provider = new DESCryptoServiceProvider();
provider.Key = Encoding.ASCII.GetBytes(key.Substring(0, 8));
prov ......
一、创建文件夹
#region 创建文件夹
/// <summary>
/// Self_Function:创建文件夹
/// </summary>
/// <param name="path">创建文件夹的路径</param>
/// <param name="noyes">隐藏文件夹True 普通文件夹False</param>
public void FileNewfile(string path, bool noyes)
{
if (noyes)
{
//若文件夹不存在则新建文件夹
if (!Directory.Exists(path))
{
//新建文件夹
Direc ......
if (FileUpload1.HasFile)
{
string fileContentType = FileUpload1.PostedFile.ContentType;
//限制上传的类型 txt/jpg/word
if (fileContentType == "text/plain"||"image/jpg"||"application/msword"||"image/gif" )
{
string name = FileUpload1.PostedFile.FileName; // 客户端文件路径
FileInfo file = new FileInfo(name);
&nbs ......
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="100%">
<param name="movie" value="<%= ResolveUrl("~/SWF/banner.swf")%>" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="<%= ResolveUrl("~/SWF/banner.swf")%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100%" height="100%" wmode="transparent"></embed>
</object> ......
如果你不总是用 Windows
上的 Internet
Explorer
来上网的话,你可能会注意到,许多网站上的视频点播之类的多媒体内容,你无法直接在 Internet Explorer
以外的其它浏览器中观看,比如明明已经安装
了插件却提示缺少插件,或者什么都不提示出现空的框框,或者显
示了播放器插件却始终连不上打不开之类的问题,而在 Internet Explorer
上却能够正确的打开并播放。显然这不是由于网络不通或者媒体不存在造成的,而是由于网页内的代码
有问题。你可能觉得这无关紧要,因为你已经习惯用 Internet Explorer
来浏览它们了;也可能你曾为此而头疼,如果你是一个 Linux
用户。可是不管怎么样,如果能在所有操作系统平台的所有浏览器上都能正常播放这些多媒体内容,总是一件好的事情。本文就是来解决这些问题的。
本 文将介绍如何在网页中內嵌 Windows Media
、RealPlayer
、Quicktime
和 Flash
的完美方法
。
这些方法适用于 Windows
、Linux
、Mac OS X
等操作系统平台上的 Internet Explorer
、Mozilla
、Firefox
、NetScape
、Opera
等多种浏览器。
完美内嵌 Windows Media
完美内嵌 RealPlayer (RealMedia)
完美内嵌 Quicktim ......
如果你不总是用 Windows
上的 Internet
Explorer
来上网的话,你可能会注意到,许多网站上的视频点播之类的多媒体内容,你无法直接在 Internet Explorer
以外的其它浏览器中观看,比如明明已经安装
了插件却提示缺少插件,或者什么都不提示出现空的框框,或者显
示了播放器插件却始终连不上打不开之类的问题,而在 Internet Explorer
上却能够正确的打开并播放。显然这不是由于网络不通或者媒体不存在造成的,而是由于网页内的代码
有问题。你可能觉得这无关紧要,因为你已经习惯用 Internet Explorer
来浏览它们了;也可能你曾为此而头疼,如果你是一个 Linux
用户。可是不管怎么样,如果能在所有操作系统平台的所有浏览器上都能正常播放这些多媒体内容,总是一件好的事情。本文就是来解决这些问题的。
本 文将介绍如何在网页中內嵌 Windows Media
、RealPlayer
、Quicktime
和 Flash
的完美方法
。
这些方法适用于 Windows
、Linux
、Mac OS X
等操作系统平台上的 Internet Explorer
、Mozilla
、Firefox
、NetScape
、Opera
等多种浏览器。
完美内嵌 Windows Media
完美内嵌 RealPlayer (RealMedia)
完美内嵌 Quicktim ......