摘要: using System.Web;namespace DotNet.Utilities{ /// <summary> /// 客户端脚本输出 /// </summary> public class JsHelper { /// <summary> /// 弹出信息,并跳转指定页面。 /// </summary> public static void AlertAndRedirect(string message, string toURL) { string js = "<script language=javascript> 阅读全文
posted @ 2012-10-26 00:12 蓬莱仙羽 阅读(221) 评论(0) 推荐(0)
摘要: using System.Text;namespace DotNet.Utilities{ //页面中弹出对话框 public class MessageBox { private MessageBox() { } #region 显示消息提示对话框 /// <summary> /// 显示消息提示对话框 /// </summary> /// <param name="page">当前页面指针,一般为this</param> /// <param name="msg">提示信息</para 阅读全文
posted @ 2012-10-26 00:10 蓬莱仙羽 阅读(140) 评论(0) 推荐(0)
摘要: using System;using System.Text;using System.Web;using System.IO;namespace DotNet.Utilities{ public class FileOperate { #region 写文件 protected void Write_Txt(string FileName, string Content) { Encoding code = Encoding.GetEncoding("gb2312"); string htmlfilename = HttpContext.Current.Server.Ma 阅读全文
posted @ 2012-10-26 00:08 蓬莱仙羽 阅读(143) 评论(0) 推荐(0)
摘要: using System;using System.Text;using System.IO;namespace DotNet.Utilities{ /// <summary> /// 文件操作夹 /// </summary> public static class DirFile { #region 检测指定目录是否存在 /// <summary> /// 检测指定目录是否存在 /// </summary> /// <param name="directoryPath">目录的绝对路径</param> 阅读全文
posted @ 2012-10-26 00:07 蓬莱仙羽 阅读(149) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;namespace DotNet.Utilities{ /// <summary> /// 字符串操作类 /// 1、GetStrArray(string str, char speater, bool toLower) 把字符串按照分隔符转换成 List /// 2、GetStrArray(string str) 把字符串转 按照, 分割 换为数据 /// 3、GetArraySt 阅读全文
posted @ 2012-10-26 00:05 蓬莱仙羽 阅读(921) 评论(0) 推荐(0)
摘要: #region set connection string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= "+this.txtPath.Text+";Extended Properties=Excel 8.0;"; myDataReader = null; craboDbConnection = new OleDbConnection(strConn); OleDbCommand myOleDbCommand = new OleDbCommand("SELECT * FROM 阅读全文
posted @ 2012-10-24 16:02 蓬莱仙羽 阅读(163) 评论(0) 推荐(0)
摘要: using System;using System.Windows.Forms;namespace WindowsFormsApplication2{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Uri address = new Uri(textBox1.Text);//创建uri类型变量,存储浏览网页地址 webBrowser1.Url = address; } pr 阅读全文
posted @ 2012-10-23 21:42 蓬莱仙羽 阅读(166) 评论(0) 推荐(0)
摘要: protected void Upload() { //判断是否选择文件 if (FileUpload1.HasFile) { string fileContentType = FileUpload1.PostedFile.ContentType;//获取文件类型 //判断类型是否符合条件 if (fileContentType == "image/bmp" || fileContentType == "image/gif" || fileContentType == "image/pjpeg"||fileContentType==& 阅读全文
posted @ 2012-10-22 20:25 蓬莱仙羽 阅读(217) 评论(0) 推荐(0)
摘要: using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class CalendarThree : System.Web. 阅读全文
posted @ 2012-10-22 16:30 蓬莱仙羽 阅读(285) 评论(0) 推荐(0)
摘要: 如何运用内置对象session和application对象实现统计在线人数首先创建一个全局应用程序类Global.asaxprotected void Application_Start(object sender, EventArgs e) { if (Application["CountOnline"] == null) { Application["CountOnline"] = 0; } } //设置session对象,生存时间为1分钟 protected void Session_Start(object sender, EventArgs e 阅读全文
posted @ 2012-10-22 16:01 蓬莱仙羽 阅读(177) 评论(1) 推荐(0)