Time of Update: 2018-12-06
著作權屬於原作者,我只是排版。1、 sizeof應用在結構上的情況請看下面的結構:struct MyStruct{double dda1;char dda;int type;};對結構MyStruct採用sizeof會出現什麼結果呢?sizeof(MyStruct)為多少呢?也許你會這樣求:sizeof(MyStruct)=sizeof(double) sizeof(char)
Time of Update: 2018-12-06
C#提供了Mutex與Interlocked這兩個與線程相關的類,都在Threading命名空間下! Mutex中提供了WiteOne,ReleaseMutex 兩個執行個體方法:WiteOne的作用是"阻塞當前線程,提供對該線程的原子操作"也就是說當一個線程遇到WiteOne的時候,如果在WiteOne裡面沒有線程在操作,則此線程進去操作而裡面有線程的時候,所有到此的線程均需要排隊等候裡面的線程執行完畢而控制這樣操作的結束標記就是使用ReleaseMutex 方法!
Time of Update: 2018-12-06
using System;using System.Configuration;using System.Collections;using System.Data;using System.Data.OleDb;namespace MyData{ public static class Class_oledb_conn { //public static string ConnStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Time of Update: 2018-12-06
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace WebCamera{ class showVideo { // showVideo calls [DllImport("avicap32.dll")] public static extern IntPtr
Time of Update: 2018-12-06
[問題]我寫了一段C#表單代碼,運行時沒有按我指定的案頭位置顯示。不知道是為什嗎?這段代碼如下: public class MyForm : Form{ MyForm() { Text = "Why doesn't this form go where I want it to go?" ; DesktopLocation = new System.Drawing.Point (500, 500) ; } static void Main() { Run(new
Time of Update: 2018-12-06
C-Sharp provides a File class which is used in manipulating text files. The File class is within the System namespace. Also we can use the StreamReader and StreamWriter classes, which are within the System.IO, namespace for reading from and writing
Time of Update: 2018-12-06
/// <summary> /// 移動檔案 /// </summary> /// <param name="source">來源目錄</param> /// <param name="target">目標目錄</param> private bool MoveFolderTo(string srcPath, string tgtPath)
Time of Update: 2018-12-06
所謂"綁架"就是把其他Win32程式的表單嵌入到我們託管的WinForm中.網上已經用很多java版和Delphi版還有WPF的.我在這裡補充 C#版的.定義需要的Win32
Time of Update: 2018-12-06
One of sound-like-simple questions is “how to make your application truly Full Screen” i.e. not showing Taskbar or anything like that.Initial approach is obvious: targetForm.WindowState = FormWindowState.Maximized; targetForm.FormBorderStyle =
Time of Update: 2018-12-06
這是從網上找來的,收藏一下備用,用到之處可以節省不少時間哦! 只能輸入數字: "^[0-9]*$"
Time of Update: 2018-12-06
View Code 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.IO; 6 7 namespace CTest 8 { 9 class PropertyFileOperator10 {11 private StreamReader sr = null;12 /// <
Time of Update: 2018-12-06
C#讀取圖片EXIF資訊的方法,今天在網上看到的,轉載過來備用!以後也許用得上,這是個老方法了,如果誰有最新的方法請給我留言,謝謝!#endregion#region 資料轉換結構/// summary>/// 轉換資料結構/// /summary>public struct MetadataDetail{public string Hex;//十六進位字串public string RawValueAsString;//原始值串public string DisplayValue;
Time of Update: 2018-12-06
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System.Text;using System.Net;using System.IO;namespace YourNameSpace{ /// <summary> ///
Time of Update: 2018-12-06
Throw會拋出/傳遞異常,通過在catch塊裡使用throw語句.可以改變產生的異常,比如我們可以拋出一個新的異常,throw語句有各種各樣的,並且很有必要.例子我們首先看一下三個方法,分別叫做A,B,C,他們使用不同的throw語句。方法A使用了無參的throw語句。這可以被看作是rethrow(繼續拋出)—他會拋出已經出現的同樣的異常繼續,方法B
Time of Update: 2018-12-06
Ambiguous operators need parentheses -----------不明確的運算需要用括弧括起 Ambiguous symbol ''xxx'' ----------------不明確的符號 Argument list syntax error ----------------參數表語法錯誤 Array bounds missing ------------------丟失數組界限符 Array size toolarge
Time of Update: 2018-12-06
首先看下:然後是兩張gif的對比 //原本圖是正著走的
Time of Update: 2018-12-06
今天突然要用到提取漢字拼音首字母的功能,去網上找了找,發現沒有幾個好用的,決定自己寫一個,效果還不錯,發出來大家一起研究下,分享給大家!直接入主題:1.首先對編碼進行定義 #region 編碼定義 private static int[] pyvalue = new int[] { -20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -200
Time of Update: 2018-12-06
NPLOT只有.NET1.1與.NET2.0版本,要在.NET4.0使用會出現問題。下面是解決方案。 下載NPLOT-0.9.10.0的源碼。 在VS2010建立一個類庫項目,刪除自動建立的cs檔案Class1.cs將源碼src檔案夾的所有檔案複製到該項目的檔案目錄下,在項目中添加這些檔案 試著編譯一下,有錯誤右擊引用,選擇添加引用 選擇.NET選擇夾,添加Systm.Drawing , System.Windws.Form , System.Web 空間再編譯一下,還有錯誤,
Time of Update: 2018-12-06
C# 使用NPlot繪圖技巧(2010-07-05 19:14:05)標籤:cnplot繪圖it分類: 學習///首先要將下載的NPlot.dll加到工具箱裡,拖一個控制項到表單上,聲明using NPlot; ////////對所繪的圖進行列印與儲存//////////private voidprint(){ myPlot.Print(true);}private void save(){ saveFileDialog1.Filter ="位元影像(*.bmp)|*.bmp|JPEG(
Time of Update: 2018-12-06
第一步:添加表單就不需要我教了吧 ! 在工具箱裡面找到CrystalReportViewer控制項拖到表單裡面,第二步:右鍵添加新項 找到資料集 DataSet1.xsd第三步: 繼續添加新項 Crystal報表 CrystalReport1.rpt 進入的時候選擇空白報表第四步:在DataSet1.xsd 雙擊進去 右鍵添加 -TableAdapter 給它命名:此名你自己定義“DsCardConsumption” 然後根據提示串連資料庫 然後寫SQL語句這個 資料集就算完成了