Time of Update: 2018-12-07
public static void StartClient() { // Data buffer for incoming data. byte[] bytes = new byte[1024]; // Connect to a remote device. try { // Establish the remote endpoint
Time of Update: 2018-12-07
// Incoming data from the client. public static string data = null; public static void StartListening() { // Data buffer for incoming data. byte[] bytes = new Byte[1024]; // Establish the local endpoint for the socket.
Time of Update: 2018-12-07
Assembly(c#中簡單說明)2008-07-11 00:27什麼是Assembly(程式集)?
Time of Update: 2018-12-07
private void button2_Click(object sender, EventArgs e) { DataTable dt = this.GetTable("select * from sysobjects where xtype='u'"); for (int i = 0; i < dt.Rows.Count-1; i++) { string tableBean
Time of Update: 2018-12-07
goto (C# 參考)goto 陳述式將程式控制直接轉移到標記陳述式。 備註 goto 的常見用法是轉移控制至特定的 switch-case 標記或 switch 陳述式中預設的標記。goto 陳述式對於跳出複雜的巢狀迴圈也很有用。 範例 下列範例說明在 switch 陳述式中使用 goto。 複製程式碼// statements_goto_switch.csusing System;class SwitchTest{static void Main(){Console.WriteLine(
Time of Update: 2018-12-07
曾經對委託和事件非常頭疼,好在現在以自己的方式入門了,就行以自己的方式把它過一遍,當作學習日記吧。 委託(delegate)是一種參考型別,我們在處理他的時候要當作類來看待而不是方法,說白了委託就是對方法或者方法列表的引用,調用一個委託執行個體就好像是調用c++中的指標一樣,他封裝了對制定方法的引用,或者說委託起到的是橋樑的作用,執行個體後的委派物件會將給定的參數傳遞給他所回調的方法,並去執行方法。 看一個簡單的例子: //聲明一個委託 delegate
Time of Update: 2018-12-07
在windows 編程中用到最多的就是控制項的時間了,微軟給我們很好的方式,把注意力放到事件執行方法的設計和編碼上,但是但我們真正弄懂了事件的真正出發執行原理的話,對我們的編程的提高真是非常榜的,例如在windows編程中 如果我單擊了一個button按鈕觸發了button 的click事件 Button1_Click(){} ,
Time of Update: 2018-12-07
uint-----byte[]-----char[]-----string 在在做一些互操作的時候往往需要一些類型的相互轉換,比如用c#訪問win32api的時候往往需要向api中傳入DWORD參數 即:uint參數這些數值所表示的資料在實際的應用中可能需要以字元的形式顯示,但是c#對api的關係無法跟c++相比,所以在c#中進行一些類型資料的轉換十分必要了, 下面將用到的一些簡單的轉換操作貼上來,方便記憶 uint--->byte[]
Time of Update: 2018-12-07
很多C++或者驅動程式或者嵌入式設計人員都會對結構體對齊問題深有感觸。錯與對之間竟然就是這麼單純,你有沒有經曆過驅動調試藍屏?如果有的話除了分析藍屏碼之外是不是會無意識考慮到參數長度匹配問題,可能你的結構體布局又出問題了?作為.NET開發人員,如果通過互操作跟本地代碼進行互動話,出現這種問題的情況就更多了,更專業的說是不是我的結構體封送出現了問題?很簡單了Marshals.Sizeof()下就知道了。結構體在被編譯器編譯的時候會被自動的按照某種方式對齊排序,其目的是減少CPU讀取資料的次數以提高
Time of Update: 2018-12-07
以前一直用一個叫做“FormatDesiger”的小工具,來測試字串格式化的輸出,最近在用的時候發現有幾個類型沒有,如byte,guid,今天把FormatDesiger稍微改了一下,增加了這幾個類型。工具很簡單,可以用來測試DateTime、Int16、Int32、Int64、Decimal、Single、Double、Byte、Guid 這幾個類型的ToString格式化輸出。應園子裡朋友的建議,此工具還整合了一些常用的格式化字串,使用的時候,可以從下拉框選擇。下載
Time of Update: 2018-12-07
using System.Threading; namespace ConsoleThrea{ class Program { static void Main(string[] args) { Thread thread = new Thread(new ThreadStart(Print)); thread.Start(); Thread thread2 = new
Time of Update: 2018-12-07
protected Intermec.DataCollection.BarcodeReader gScanner; public Scan() { InitializeComponent(); } #region Intermec 掃描處理 #region 啟動Intermec掃描 protected void OpenScanner() { if (Common.exceptionFlag == "0") { Application.DoEvents(); if (gScanner !=
Time of Update: 2018-12-07
#實現對Word檔案讀寫 手頭上的一個項目報表相對比較簡單,所以報表列印採用VBA引擎,通過定製Word模版,然後根據模版需要填充資料,然後OK,列印即可。 實現方法:首先需要引用VBA組建,我用的是Office2003 Professional,Dll版本號碼為Microsoft Word11.0 另外當然還需要引用Interop.Word.Dll. 代碼如下:///#region 開啟Word文檔,並且返回對象wDoc,wDoc/// ///
Time of Update: 2018-12-07
public static void ExportExcel(DataSet ds, string strExcelFileName) { object objOpt = System.Reflection.Missing.Value; Excel.Application excel = new Excel.Application(); excel.Visible = true; Excel.
Time of Update: 2018-12-07
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using
Time of Update: 2018-12-07
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;namespace TemplateFileDelete{ public partial class
Time of Update: 2018-12-07
protected void BtGroup_ServerClick(object sender, EventArgs e) { //產業群首頁 string tempGroupData = GetHttpData("http://www.goudiannao.com/Group/index.aspx"); using (StreamWriter sw = new StreamWriter(this.Request.
Time of Update: 2018-12-07
C#兼職人員|C#兼職系統開發人員|C#兼職開發人員熟練C#語言、Html、SQL Server、JavaScript等。要有一個以上基於asp.net ,C#,SQL Server 平台的開發經驗。精通C#(工作環境vs2003,VS2005,vs2008,mssql2000,MSSQL2005); 2. 精通MSSQL,非常熟練的編寫預存程序等項目經驗要求有網站系統開發經驗。3年以上網站程式開發經驗_,經獨立(組織)完成過中型網站的開發;熟悉C#和SQLserver程式開發;聯絡
Time of Update: 2018-12-07
public void BindCheckBoxList(CheckBoxList cbl, bool isText, string values) { values = string.IsNullOrEmpty(values) ? ("") : (values); if (values.Length > 0) { if (isText) {
Time of Update: 2018-12-07
c#字串轉數位函數|c#字串轉數位無錯函數|c#字串轉數位最好函數 //字串轉整數public int GetInt(string str) { int tempInt = 0; int.TryParse(str,out tempInt); return tempInt; }/字串轉整數浮點 public decimal GetDecimal(string str) { decimal tempDecimal = 0; decimal.TryParse(str, out