Time of Update: 2016-10-24
標籤:addition builder _id mem tostring rss 指令碼 fresh form表單 常用的方法 1 Navigate(string
Time of Update: 2016-10-27
標籤:eof object 語言 output init textbox info 符號 box 鎮場詩:———大夢誰覺,水月中建部落格。百千磨難,才知世事無常。———今持佛語,技術無量願學。願
Time of Update: 2016-10-18
標籤:LinQ的進階查詢:模糊查con.Car.Where(r=>r.Name.Contains(cname)).ToList();以..開頭con.car.Where(r => r.name.StartsWith(TextBox1.Text)).ToList(); 以..結尾con.car.Where(r => r.name.EndsWith(TextBox1.Text)).ToList(); 求最大值con.car.Max(r =>
Time of Update: 2016-10-22
標籤:com span for sts one tar play show cto &
Time of Update: 2016-10-17
標籤:其實在C#中使用webBrowser大家應該都會了,論壇也有很多相前的例子大家可以查詢一下就知道了但是像直接使用瀏覽器一樣設定代理 的方法可能很多人還不知道吧。這個其實是調用一個Dll檔案進行設定的,下面大家跟我一起來看看吧首先還是要先建一個結構就是代理資訊的結構體如下[C#] 純文字查看 複製代碼?010203040506070809/// <summary> /// 代理結構體 ///
Time of Update: 2016-10-08
標籤:只需要傳入datagridview的name即可。 1 //匯出Excel()方法 2 public void ToExcel(DataGridView dataGridView) 3 { 4 //執行個體化一個Excel.Application對象 5 Microsoft.Office.Interop.Excel.Application excel = new
Time of Update: 2016-10-15
標籤:Html表單文本類:<input type="text" /> - 文字框 <input type="password" /> - 密碼框 <textarea></textarea> - 文本域 <input type="hidden" /> - 隱藏欄位 按鈕類:<input type="button" value="按鈕1" /><input
Time of Update: 2016-10-09
標籤:LINQ (Language-Integrated Query,Language-integrated Query (LINQ))。LINQ to Objects、LINQ to SQL、LINQ to DataSet和LINQ to XML,它們分別查詢和處理對象資料(如集合)、關係資料(如SQL Server資料庫等)、DataSet對象資料和XML結構資料。 主要對資料進行操作-----------------------------------------
Time of Update: 2016-08-29
標籤: 一,先開啟開始或繼續測量某個時間間隔的已耗用時間,然後停止,最後重設時間,輸出.using System;using System.Collections.Generic;using System.Diagnostics;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class TestPerformance :
Time of Update: 2016-08-26
標籤:1、==是直接比較實值型別的值或參考型別的引用地址,但==不能用於struct,struct只能用equals來比較。==一般情況下與object.equals得到的結果是相等的。2、ReferenceEquals為Object下的靜態方法,用於比較引用地址。因此所有實值型別的比較都為false。string比較特殊,只要字元相等,==、equals、Object.ReferenceEquals
Time of Update: 2016-07-19
標籤:首先我們要做的就是先把IIS(Internet資訊服務)開啟,我用的是win8 的系統,所以這裡以win8系統的操作來講一、IIS的一些事先操作1、開啟控制台,然後進入 程式2、進入程式以後我們找到 啟用或關閉Windows功能 3、進入以後把 Internet資訊服 務 的都選上,單擊“確定“上述的步驟好了以後我們退回到 控制台 ,找到 系統和安全 裡面的
Time of Update: 2016-07-12
標籤:實現如下效果:實現方式如下:using System;using System.Drawing.Printing;using System.Runtime.InteropServices;using System.Windows.Forms;namespace PISS.View.CustomControl{ public partial class PrinterConfigMessBox : Form { #region 定義、構造、初始化
Time of Update: 2016-07-05
標籤:0. 目錄C#6 新增特性目錄1. 老版本的代碼 1 internal class Person 2 { 3 public string Name { get; set; } 4 public int Age { get; set; } 5 6 public override string ToString() 7 { 8 return string.Format("[name={0},age={1}]", Name, Age); 9
Time of Update: 2016-06-30
標籤:上篇.net平台下C#socket通訊(上)介紹了socket通訊的基本原理及最基本的通訊方式。本文在此基礎上就socket通訊時經常遇到的問題做一個簡單總結,都是項目中的一些小問題,拿來此處便於下次使用,同時對在使用socket時出現些許問題的同仁們多一個粗淺建議。不足之處請提出,謝謝。本文主要講述:1、正常通訊中握手建立2、一對多的通訊3、發送接收資料格式轉換4、資源釋放5、開啟並保持服務監聽 1、握手建立正常的通訊通道 項目需要通訊的雙方(假設是一個上位機、一個下位機)之
Time of Update: 2016-11-10
寫類庫項目時,經常會有某些特殊業務需要用到伺服器端的實體路徑,使用傳統的 System.IO.Directory.GetCurrentDirectory()方法返回的則是WINNT\System32目錄,這個一般不能滿 足正常的業務需求,而要得到具體運行DLL所在的物理目錄可以通過Assembly.GetExecutingAssembly().CodeBase屬 性來取得,具體參考方法如下:/// /// 擷取Assembly的運行路徑 /// /// private
Time of Update: 2016-11-10
using System;using System.IO;string filetomerge=@"C:\temp\data.bin";string targetpath=@"D:\store";string strFileName = filetomerge.Substring(filetomerge.LastIndexOf(Path.DirectorySeparatorChar) + 1);FileStream fsr1 = new FileStream(targetpath+
Time of Update: 2016-11-10
using System.IO;using System.Windows.Forms; OpenFileDialog dlg = new OpenFileDialog();dlg.Filter ="All files (*.*)|*.*";dlg.FilterIndex = 1;dlg.RestoreDirectory = true;dlg.Multiselect = true;if (dlg.ShowDialog() == DialogResult.OK){ foreach
Time of Update: 2016-11-10
這項API提供的實用功能常常用來管理應用程式中的服務,而不必到控制台的管理服務中進行操作。ServiceController controller = new ServiceController(“e-M-POWER”); controller.Start(); if (controller.CanPauseAndContinue) { controller.Pause(); controller.Continue();
Time of Update: 2016-11-10
用下面的方法,可以檢查.NET給程式分配的記憶體數量long available = GC.GetTotalMemory(false);Console.WriteLine(“Before allocations: {0:N0}”, available);int allocSize = 40000000;byte[] bigArray = new byte[allocSize];available =
Time of Update: 2016-11-10
比如我們鎖定系統後,如果QQ沒有退出,則它會顯示了忙碌狀態。請添加命名空間Microsoft.Win32,然後對註冊下面的事件。. DisplaySettingsChanged (包含Changing) 顯示設定. InstalledFontsChanged 字型變化. PaletteChanged. PowerModeChanged 電源狀態. SessionEnded (使用者正在登出或是會話結束). SessionSwitch (變更目前使用者). TimeChanged 時間改變.