asp.net向文件写入日志
using System;
using System.IO;
namespace WriteLog
{
/// <summary>
/// WriteInLog 的摘要说明。
/// </summary>
public class WriteInLog
{
private string logFileName;
private int logFileSizes;
/// <summary>
/// 写入日志文件
/// </summary>
public WriteInLog()
{
logFileName = @"d:\logfile.txt";
}
/// <summary>
/// 自动删除日志文件大小,此方法已经重载.
/// </summary>
/// <param name="fileSize">日志文件大小,单位KB</param>
public WriteInLog(int fileSize):this()
{
if(fileSize != 0)
{
this.logFileSizes = fileSize * 1024;
}
&nb
相关文档:
1 示例xml文件 model.xml
<?xml version="1.0" encoding="utf-8" ?>
<DrRoot>
<SiteName>xml操作示例</SiteName>
<SiteUrl>www.abc.com.cn</SiteUrl>
.net开源论坛
<SiteKeyWord>xml操作示例</SiteKeyWord>
<FileType>gif|jpg| ......
1、由dataset生成
public void CreateExcel(DataSet ds,string typeid,string FileName)
{
HttpResponse resp;
resp = Page.Response;
resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
resp.AppendHeader("Content-Dis ......
1、由dataset生成
public void CreateExcel(DataSet ds,string typeid,string FileName)
{
HttpResponse resp;
resp = Page.Response;
resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
resp.AppendHeader("Conte ......
1)创建txt文件【web.config】
--------------------------------------------------------------------
<appSettings>
<add key="EditChars" value="D:\Site\ZJPS\TextFile\EditChars.txt"/>
</appSettings>
2) 页面的CS文件中:
----------------- ......
当我输入一个关键字想按回车键就可以搜索,但由于页面上还有其他的Button,所以默认本不是我的搜索按钮,在网上搜了些解决方案,最多的是如下这种方式:
在asp.net中,如何回车触发指定按钮的事件?
假设:
<asp:TextBox id="tbInput" runat="server" Width="240px"></asp:TextBox>
<asp:Button ......