asp.net日志
string path = "...\\Debug\\log.txt";
if (!File.Exists(path))
{
StreamWriter sw1;
sw1 = File.CreateText(path);
sw1.Close();
}
string str = System.DateTime.Now.Year.ToString() + "年" + System.DateTime.Now.Month.ToString() + "月" + System.DateTime.Now.Day.ToString() + "日 " + System.DateTime.Now.Hour.ToString() + ":" + System.DateTime.Now.Minute.ToString() + ":" + System.DateTime.Now.Second.ToString() + " " + "数据Web服务无法访问或者网络不通. ";
StreamWriter sw = File.AppendText(path);
sw.WriteLine(str);
sw.Close();
return;
相关文档:
下载页面:
<a href="download.ashx?url=<%=Server.UrlEncode("说明.txt")%>">下载</a>
------------------------------------------------------------------------------
download.ashx
<%@ WebHandler Language="C#" Class="download" %>
using System;
using System.Web;
public ......
ASP.NET实现自适应图片大小的弹出窗口
在最近的项目中,遇到一个问题,要实现这样的效果:
点pic_small.Aspx页面的缩略图后弹出pic_all.aspx页面,pic_all.aspx页面的大小要根据图片大小自动调整,而且要有图片的说明信息,还可以点上一幅和下一幅等进行翻页。
实现过程如下:
pic_small.Aspx页面缩略图处的代码为: ......
ASP.net 仿QQ弹出窗口
〔转〕http://hi.baidu.com/liyukun8203/blog/item/d9244dfcdb78e388b901a019.html
最近在做内部管理,需要用到这个东西来提醒,所以就把它做成一个类,直接调用,满方便的.贴一下代码,大家看一下
Code
1 using System;
2 using System.Web;
3 using System.Collections.Generic;
4 using Sy ......
切记,切记 DateTime.Now.Date.ToString("yyyy年MM月dd日"); //MM 要大写,否则会是00,不是真实的月份 private void getDate()
{
date.Text = DateTime.Now.Date.ToString("yyyy年MM月dd日"); //这个随意的:yyyy-MM-dd 也可以
string Temp="";
switch (DateTime.Now.DayOfWeek)
{
case DayO ......