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;
相关文档:
1、DateTime 数字型
System.DateTime currentTime=new System.DateTime();
1.1 取当前年月日时分秒
currentTime=System.DateTime.Now;
1.2 取当前年
int 年=currentTime.Year;
1.3 取当前月 &n ......
1.弹出对话框.
a. 弹出对话框:
C# codeClientScript.RegisterStartupScript(this.GetType(), "",
"<script>window.alert('该会员没有提交申请,请重新提交!')</script>");
b.转向指定页面
C# code Response.Write("
<script>window.location='http://www. ......
方法一:
新建一个页面然后在页面拖一个GridView控件在属性框中设置GridView控件的AllowPaing属性为True 然后再设置GridView的PageSize属性,源文件如下:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames ="classId" CellPadding="5" OnRowDeleting="GridView1_RowDeleting" All ......
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 ......
/// <summary>
/// 字符串切割
/// </summary>
/// <param name="p_SrcString"></param>
/// <param name="p_Length"></param>
/// <returns></returns>
public static string GetSubString(string p_SrcString, int ......