随笔分类 -  C#

nusoap 中文乱码 C# 调用
摘要:<?phprequire_once('../lib/nusoap.php');$server = new soap_server();$server->soap_defencoding='UTF-8';$server->decode_utf8=false;$server->configureWSDL('Service1');$server->register('Welcome',array('name' => 'xsd:string'),array('re 阅读全文
posted @ 2008-06-12 15:24 wkjs 阅读(238) 评论(0) 推荐(0)
从模板创建Excel程序
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication3{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidbutton1_Click(objectsender,EventArgse) 阅读全文
posted @ 2008-03-04 13:33 wkjs 阅读(253) 评论(0) 推荐(0)
一个项目包含两个Main函数编辑方式
摘要:usingSystem;//一个项目中包含两个Main函数namespaceWalter.Example{///<summary>///第一个类///编译方式为:cscDemo.cs/main:Walter.Example.Client///</summary>classClient{publicstaticintMain(){MathExample.Main();return0;}}///<summary>///第二个类///编译方式为:cscDemo.cs/main:Walter.Example.MathExample///</summary> 阅读全文
posted @ 2008-02-25 12:04 wkjs 阅读(326) 评论(0) 推荐(0)
文件
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Runtime.InteropServices;namespaceDemo1{///<summary>///配置文件操作///</summary>publicpartialclassForm1:Form{///<summary>///在初 阅读全文
posted @ 2008-02-21 13:02 wkjs 阅读(152) 评论(0) 推荐(0)
正则表达式验证
摘要:///<summary>///正则表达式验证///</summary>///<paramname="input">检验数据</param>///<paramname="pattern">正则表达式</param>///<returns>检验结果</returns>privateboolbMatch(stringinput,stringpattern){//声明一个Regex对象System.Text.RegularExpressions.Regexr=newS 阅读全文
posted @ 2008-01-29 16:54 wkjs 阅读(158) 评论(0) 推荐(0)
Singleton
摘要:publicsealedclassSingleton<T>whereT:new()...{privatestaticTinstance=newT();privatestaticobjectlockHelper=newobject();privateSingleton()...{}publicstaticTGetInstance()...{if(instance==null)...{lock(lockHelper)...{if(instance==null)...{instance=newT();}}}returninstance;}} 阅读全文
posted @ 2008-01-23 15:35 wkjs 阅读(137) 评论(0) 推荐(0)
ADO 访问数据库
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsApplication1{publicpartialclassForm1:Form{///<summary>//////</summary>privateADODB.Connectioncn=newADODB.Connection();/// 阅读全文
posted @ 2008-01-21 11:25 wkjs 阅读(171) 评论(0) 推荐(0)
文件批量改名
摘要:privatevoidGhangeNames(stringfilepath,stringsfm,intk){DirectoryInfoinf=newDirectoryInfo(filepath);FileInfo[]files=inf.GetFiles();try{for(inti=0;i<files.Length;i++){listBox1.Items.Add(files[i].Name);listBox2.Items.Add(textBox2.Text+(k+i).ToString(sfm)+files[i].Name.Substring(files[i].Name.LastInde 阅读全文
posted @ 2008-01-14 16:41 wkjs 阅读(159) 评论(0) 推荐(0)
拖拽功能--拖放桌面上的对象
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Diagnostics;namespaceWalter.K.Wang{publicpartialclassForm1:Form{privateProcessprocess=newProcess();publicForm1(){Initial 阅读全文
posted @ 2007-12-03 09:30 wkjs 阅读(252) 评论(0) 推荐(0)
拖拽功能--拖动列表中的项
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWalter.K.Wang{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidlistBox1_MouseDown(objectsender, 阅读全文
posted @ 2007-12-03 09:29 wkjs 阅读(208) 评论(0) 推荐(0)
关机、重启、登出、关闭电源操作
摘要://ShutDown.csusingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Runtime.InteropServices;namespaceWalter.K.Wang{///<summary>//////</summary>publicclassShutDown{///<summary>//////</summary>publicenumOperat{///<summary>///关闭计算机///</summary>ShutD 阅读全文
posted @ 2007-10-26 10:12 wkjs 阅读(311) 评论(0) 推荐(0)
程序开机自动启动
摘要://RunWhenStart.csusingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingMicrosoft.Win32;usingSystem.Windows.Forms;namespaceWalter.K.Wang{///<summary>//////</summary>publicclassRunWhenStart{///<summary>///开机自动启动程序///</summary>///<paramname="Started"> 阅读全文
posted @ 2007-10-26 10:07 wkjs 阅读(216) 评论(0) 推荐(0)
用户登陆操作(ASP.NET)
摘要:usingSystem;usingSystem.Data;usingSystem.Configuration;usingSystem.Web;usingSystem.Data.SqlClient;namespaceDataOperator...{/**////<summary>///Login的摘要说明///</summary>publicclassLogin...{/**////<summary>///数据库联接字符串///</summary>privatestringconnstring;/**////<summary>///数据 阅读全文
posted @ 2007-10-18 14:20 wkjs 阅读(216) 评论(0) 推荐(0)
发送电子邮件类
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Text;//添加命名空间usingSystem.Net.Mail;usingSystem.Net;namespaceWalter.K.Wang...{/**////<summary>///发送电子邮件类///</summary>publicclassMail...{/**////<summary>///发送电子邮件函数///</summary>///<paramname="txtHost">电子邮件服务 阅读全文
posted @ 2007-10-11 22:09 wkjs 阅读(233) 评论(0) 推荐(0)
C#實現自動啟動
摘要:privatevoidtoolStripMenuItem3_Click(objectsender,EventArgse)...{if(autorun==true)...{RunWhenStart(false,Application.ProductName,Application.StartupPath+@""+Application.ProductName+@".exe");autorun=false;}else...{RunWhenStart(true,Application.ProductName,Application.StartupPath+@& 阅读全文
posted @ 2007-09-19 22:04 wkjs 阅读(197) 评论(0) 推荐(0)
修該Config文件程序程式
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Configuration;usingSystem.Xml;usingSystem.Reflection;namespaceWalter.K.Wang.Config...{/**////<summary>///讀寫配置文件操作類///</summary>publicclassConfig...{/**////<summary>///讀配置文件///</summary>///<paramname=& 阅读全文
posted @ 2007-09-17 19:51 wkjs 阅读(165) 评论(0) 推荐(0)
關機程式操作類
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.Runtime.InteropServices;namespaceWalter.K.Wang.ShutDown...{/**////<summary>//////</summary>publicclassShutDown...{/**////<summary>//////</summary>publicenumOperat...{/**////<summary>///關閉計算機///< 阅读全文
posted @ 2007-09-16 22:30 wkjs 阅读(207) 评论(0) 推荐(0)
關閉程式使程式最小化
摘要:privatevoid顯示程序ToolStripMenuItem_Click(objectsender,EventArgse)...{if(顯示程序ToolStripMenuItem.Checked==false)...{this.Show();this.WindowState=System.Windows.Forms.FormWindowState.Normal;this.ShowInTaskbar=true;bclose=false;顯示程序ToolStripMenuItem.Checked=true;}else...{this.Hide();this.WindowState=System 阅读全文
posted @ 2007-09-16 22:27 wkjs 阅读(218) 评论(0) 推荐(0)
只運行一個程序之二
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Windows.Forms;usingSystem.Threading;namespaceWalter.K.Wang.Demo...{staticclassProgram...{/**////<summary>///應用程式的主要進入點。///</summary>[STAThread]staticvoidMain()...{Application.EnableVisualStyles();Application.SetCompatibleTextRenderi 阅读全文
posted @ 2007-09-16 21:58 wkjs 阅读(180) 评论(0) 推荐(0)
Windows Mobile asp.net第一個程序
摘要:<%...@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default2.aspx.cs"Inherits="Default2"%><%...@RegisterTagPrefix="mobile"Namespace="System.Web.UI.MobileControls"Assembly="System.Web.Mobile"%><htmlxmlns="htt 阅读全文
posted @ 2007-09-14 09:53 wkjs 阅读(202) 评论(0) 推荐(0)