摘要:
public static void CreateXml(string path) { XmlDocument xmldoc = new XmlDocument(); XmlTextWriter writer = new XmlTextWriter(path, Encoding.UTF8); writer.WriteStartDocument(); /*根节点*/ writer.WriteStartElement("User");//根节点 /*n... 阅读全文
摘要:
定义一个重新启动的类: class Relogin { public void Restart() { Thread thtmp = new Thread(new ParameterizedThreadStart(run)); object appName = Application.ExecutablePath; Thread.Sleep(1000); thtmp.Start(appName); } private void run(Objec... 阅读全文
摘要:
自定义一个生成日志文件的类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using PrintDatas;using System.Windows.Forms;namespace PrintDatas.Functionlayer{ public class Log { /// /// 日志系统文件(下载) /// /// 处于什么位置 /// 店铺名称 ... 阅读全文
摘要:
自定义一个序列化类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Runtime.Serialization.Formatters.Binary;using System.Windows.Forms;namespace PrintDatas.Functionlayer{ class SerializableOperate { /// /// 序列化Font /// ... 阅读全文
摘要:
public string GetPYString(string str) { string tempStr = ""; foreach (char c in str) { if ((int)c >= 33 && (int)c /// 取单个字符的拼音声母 /// /// 要转换的单个汉字 /// 拼音声母 string GetPYChar(string c) { byte... 阅读全文
摘要:
static ArrayList Sheets(string filepath) { ArrayList al = new ArrayList(); string strconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties=Excel 8.0;"; OleDbConnection conn = new OleDbConnection(strconn); conn.Op... 阅读全文
摘要:
private static void DataTableToSQLServer(DataTable dt) { string connectionString = "";//GetConnectionString(); using (SqlConnection destinationConnection = new SqlConnection(connectionString)) { destinationConnection.Open(); us... 阅读全文
摘要:
static void Main(string[] args) {//442048086191605,140454 aa("442048086191605'--", ""); } static void aa(string username, string pwd) { string sql = @"select * from boby_info where tid=@use and intBobyInfoID=@pwd"; SqlConnection conn = ne... 阅读全文
摘要:
在Program里写入代码: static class Program { /// /// 应用程序的主入口点。 /// [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Application.Run(new FnFather()); ... 阅读全文
摘要:
首先,定义一个带object参数的方法,代码如下: public void ThreadMethod(object ParObject) { List stid = null; SqlConnection con = null; SqlCommand cmd = null; toExport_Mutex.whatOperation optin = new toExport_Mutex.whatOperation(); try { ... 阅读全文