摘要:
static string sqlcon = "server=.;database=;Integrated Security=true;";/// /// 新增数据/// public static void Add(){ //string sqlcon = "server=.;database=;Integrated Security=true;"; SqlConnection conn=new SqlConnection(sqlcon); string sqlStr="insert into Boook(b_id,b_title,b_aut 阅读全文
摘要:
using System;using System.Text;using System.Net.Sockets;using System.Net.Mail;using System.Net;namespace DotNet.Utilities{ /// /// 网络操作相关的类 /// public class NetHelper { #region 检查设置的IP地址是否正确,返回正确的IP地址 /// /// 检查设置的IP地址是否正确,并返回正确的IP地址,无效IP地址返回"-1"。 /// /// 设置的IP地址 //public static string Get 阅读全文
摘要:
using System.Xml;using System.Data;namespace DotNet.Utilities{ /// /// Xml的操作公共类 /// public class XmlHelper { #region 字段定义 /// /// XML文件的物理路径 /// private string _filePath = string.Empty; /// /// Xml文档 /// private XmlDocument _xml; /// /// XML的根节点 /// private XmlElement _element; #endregion ... 阅读全文
摘要:
using System.Web;namespace DotNet.Utilities{ /// /// 客户端脚本输出 /// public class JsHelper { /// /// 弹出信息,并跳转指定页面。 /// public static void AlertAndRedirect(string message, string toURL) { string js = ""; HttpContext.Current.Response.Write(string.Format(js, message, toURL)); HttpContext.Current. 阅读全文
摘要:
using System.Text;namespace DotNet.Utilities{ //页面中弹出对话框 public class MessageBox { private MessageBox() { } #region 显示消息提示对话框 /// /// 显示消息提示对话框 /// /// 当前页面指针,一般为this /// 提示信息 public static void Show(System.Web.UI.Page page, string msg) { // page.RegisterStartupScript("message", "&quo 阅读全文
摘要:
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 阅读全文
摘要:
using System;using System.Text;using System.IO;namespace DotNet.Utilities{ /// /// 文件操作夹 /// public static class DirFile { #region 检测指定目录是否存在 /// /// 检测指定目录是否存在 /// /// 目录的绝对路径 /// public static bool IsExistDirectory(string directoryPath) { return Directory.Exists(directoryPath); } #endregion #... 阅读全文
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Text.RegularExpressions;namespace DotNet.Utilities{ /// /// 字符串操作类 /// 1、GetStrArray(string str, char speater, bool toLower) 把字符串按照分隔符转换成 List /// 2、GetStrArray(string str) 把字符串转 按照, 分割 换为数据 /// 3、GetArrayStr(List list, st. 阅读全文