asp.net图片上传(带重命名)
点击按钮上传FileUpload的图片
protected void Button3_Click(object sender, ImageClickEventArgs e)
{
if (FileUpload1.HasFile)
{
//重命名图片
string strFileName1 = FileUpload1.FileName; //取到上传文件的名称
string[] myfile = strFileName1.Split('.'); //把文件名与文件类型分开
string dotname = myfile[myfile.Length - 1].ToString().ToLower(); //得到文件类型
if (dotname == "gif" || dotname == "jpg")
{
string filepath = Path.GetFullPath(FileUpload1.PostedFile.FileName);
Random myrdn = new Random(); //产生随机数
strFileName1 = DateTime.Now.ToString("yyMMddHHmm") + myrdn.Next(10000).ToString() + "." + dotname;
string imgpath = Server.MapPath("UserImg/");
string folder = "b
相关文档:
1.
ClientScript.RegisterStartupScript(this.GetType(), "js1", "alert('删除成功');window.location='QuerySortList.aspx';", true);
2.
this.cmdSave.Attributes.Add("onclick", "return f_StringCheck()"); ......
public static void Purge(ref List<string>needToPurge)
{
for(int i=0;i<needToPurge.Count-1;i++)
&n ......
以下介绍两种分页,用AspNetPager和ViewState
一.AspNetPager的用法
1. 复制AspNetPager.dll到bin目录,在工具箱->选择项->浏览,添加bin下的引用。
2. 从工具箱拖个AspNetPager,改如下属性:
PageSize--每页显示的记录数
CustomInfoHTML--自定义显示文本,一般为& ......
asp.net
http://topic.csdn.net/t/20060818/14/4959087.html
http://www.agrinei.com/gridviewhelper/gridviewhelper_en.htm
http://dotnet.aspx.cc/ShowDetail.aspx?id=149E5DD7-3B32-461e-ACC6-51D1652E6746
http://www.xueit.com/html/2009-08/21_4321_00.html
http://topic.csdn.net/t/20060429/10/4722766.html
......
方法一 :使用XML控件
<% @ Page Language="C#"%>
<html>
<body>
<h3><font face="Verdana">读取XML方法一</font></h3>
<from runat=server>
<asp:Xml id="xml1" DocumentSource="grade.xml" runat="server" />
</from>
</body>
</ ......