原创 頁面使用AJAX
var time; window.onload = Monitor = function() { try { var dte = new Date();
原创 C#記錄運行時間點
System.Environment.TickCount; 單位:毫秒
原创 線程異常,而進程不死 | 每次只打開一個桌面程序
using System;using System.Windows.Forms;using System.Diagnostics;using System.Runtime.InteropServices;using System.Refl
原创 vs中用命令發佈站點
VS2005下如何用預編譯命令來發布站點:1.建議兩個文件夾WEB1,WEB2(D:/WEB1,用於存放你寫的測試源程序),(D:/WEB2,用於存放編譯後的程序)2.在DOS模式下輸入:C:/WINDOWS/Microsoft.NET/
原创 檢查網絡是否正常
private void CheckNetStatus() { string ip = tbIP.Text.Trim(); Ping p = new Ping();//創建Pin
原创 c# sqlite 數據庫加密
用了ADO.NET 2.0 SQLite Data Provider 這樣可以直接利用它來創建一個加密的sqlite數據庫。有關c#代碼如下:1、創建空的sqlite數據庫。 //數據庫名的後綴你可以直接指定,甚至沒有後綴都可以//方法
原创 獲取機器IP和MAC地址
using System;using System.Collections.Generic;using System.Text;using System.Diagnostics;using System.Text.RegularExpre
原创 利用反射機制,讀取dll,並調用其中的方法
private void UserJN(string dllName,string className,string methodName) { string classFullName
原创 C#中Thread與ThreadPool的比較
我們可以通過Thread類,一次使用一個線程,來創建和刪除線程。這種方式建立和刪除線程是很昂貴的(cpu密集型)。所以,CLR包含一個內置的線程池,供應用程序使用。這個線程池可以通過ThreadPool類訪問。 ThreadPool類會
原创 Socket實例
服務器端代碼:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing
原创 在配置文件裏增加代碼,可以顯示ibaits的日誌
<iBATIS> <logging> <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.ConsoleOutLoggerFA, IBatisNet.Com
原创 Timer的區別
System.Windows.Forms.Timer , 該 Timer 必須在 Winform 程序中使用,依賴於某個窗體;當窗體的主ui線程正在執行其他的消息時, Timer的時間就會被丟棄System.Timers.Timer 該T
原创 ADO.NET-插入多條記錄(用SqlBulkCopy類)
/// <summary> /// 批量複製 /// </summary> /// <param name="connectionString">目標表的數據庫連接字符串</param>
原创 讀取配置文件加載背景圖片,音樂
//讀取配置文件加載背景圖片,音樂 this.BackgroundImage = Image.FromFile(Path.GetFullPath(ConfigurationManager.AppSettings[
原创 克隆對象副本
#region 克隆對象副本 public T Clone<T>(T t) where T : class { MemoryStream stream = new MemorySt