Time of Update: 2018-12-03
public void AddpathPower() { string pathname = @"C:\Users\Administrator\Desktop\建立檔案夾"; string username = "Everyone";//Environment.UserName; DirectoryInfo dirinfo = new DirectoryInfo(pathname); if ((
Time of Update: 2018-12-03
1:類每次載入時,只使用載入時的建構函式,也就是說當類裡面定義多個建構函式時,同時只能使用其中一個。2:當基類沒有指定任何建構函式的時候,那麼繼承類定義的所有建構函式是不能指定調用的基類建構函式,或者說預設情況下只是調用基類的預設建構函式。3:當基類只是定義預設建構函式的時候,那麼繼承類定義的所有建構函式是只能指定調用基類預設建構函式,或者說預設情況下沒有指定就是調用基類的預設建構函式。4:當基類定義多個建構函式的時候,那麼繼承類定義的所有建構函式可以隨意指定調用基類預設建構函式,同樣默認情況下
Time of Update: 2018-12-03
首先,要添加Excel的引用,在項目裡面“添加引用”,根據系統內容的不同,有些是添加Microsoft.Office.Interop.Excel 有些是添加microsoft excel 11 object library(適合office2003環境),然後引用裡面就有microsoft.office.core和excel了。 以下摘自網上的一個有用的函數: #region 將DataGridView控制項中資料匯出到Excel
Time of Update: 2018-12-03
網路編程中Nagle演算法和Delayed ACK的測試我們是網路編程的時候,要不要禁止nagle演算法呢,下面是一個結論,大家可以參考。再付一個C#可考慮提高網路訪問效率的設定: //是否使用 Nagle 不使用 提高效率 hwr.ServicePoint.Expect100Continue = false; hwr.ServicePoint.UseNagleAlgorithm = false;
Time of Update: 2018-12-03
需要使用timer 定時器控制項 timer1.Interval 設定時間間隔timer1.Tick 到達時間間隔時觸發事件test_tick 時間處理函數timer1.Tick += new System.EventHandler(test_Tick); 委託以處理事件 ,一般可以在Form 的建構函式
Time of Update: 2018-12-03
上傳圖片的格式一定要按規定的寫,不然沒辦法正確上傳的。我在上傳的時候就是值前面沒有空一行,導致上傳不成功,很糾結的錯誤。我要類比的是一個FLASH的上傳控制項,我開始用HttpAnalyze抓包是抓不到的。後來上網搜尋到了【抓包工具】Charles
Time of Update: 2018-12-03
第一次嘗試: string question = textBox1.Text.ToString();WebClient youdao = new WebClient();youdao.Encoding = System.Text.Encoding.GetEncoding("GB2312");Uri uri = new Uri("http://xxxxxxxxxxxxxx");textBox1.Text
Time of Update: 2018-12-03
最近要做個郵件收發功能,所以在網上搜尋資料。搜尋很多都是有關JMAIL組件的文章,但這個jmail.dll組件是商業版的,免費版的不支援POP3。如果是使用發郵件功能,是可以的。但如果單單只要發郵件功能,使用C#內建的類就可以了。JMAIL還要安裝註冊之後才可以使用,很不方便。上網下載了個破解版的JMAIL
Time of Update: 2018-12-03
TCP 學名(Transmission Control Protocol)這個水蛇般漫長的名字翻譯成中文是:“傳輸控制通訊協定”。關於它,我們要記住的最重要的就是它是一個連線導向的協議(Connection-Oriented
Time of Update: 2018-12-03
一、注意虛擬解構函式的使用 假設 class CB : public CA; 這個時候若: CA *p = new CB(); delete p; 如果CA的解構函式不是虛擬話,CB的解構函式就不會被執行,而只有CA的解構函式會被執行。 很多類並不是被設計作為基類的。只有類在行為上是它的衍生類別的介面時(這些衍生類別往往在堆中分配,通過指標或引用來訪問),虛擬函數才有意義。
Time of Update: 2018-12-03
第一道:main() { printf(&unix["/021%six/012/0"], (unix)["have"] + "fun" - 0x60); }第二道:#include <stdio.h> main(t,_,a) char *a; { return!0<t?t<3?main( -79,-13,a+main( -87,1-_,main( -86,0,a+1 )+a ) ):1,t<_?main( t+1,_,a ):3,main(-94,-27+
Time of Update: 2018-12-03
作者:乾坤一笑來源:http://blog.vckbase.com/smileonce/archive/2005/06/26/8330.html摘要:介紹了C語言中的char *和字串,比較深入前幾天和清風雨交談strncpy()函數的時候,他認為“如果一個函數有一個char * str的參數,那麼str一定是一個字串”,而我對此不以為然。難得到了周末,抽得出功夫,談談我對char
Time of Update: 2018-12-03
erase的作用是,使作為參數的迭代器失效,並返回指向該迭代器下一參數的迭代器。如下:list ParticleSystem;list::iterator pointer;if(pointer->dead == true){ pointer = ParticleSystem.erase(pointer);}有一段關於錯誤使用erase的程式using namespace std;int main(){ std::listtest_list; std::list::iterator
Time of Update: 2018-12-03
IntroductionIn this article, I will give you an introduction on how to do serial port communication on .NET platform using C#. The .NET framework version 2.0 (beta) provides features for serial communication. The framework provides System.IO.Ports
Time of Update: 2018-12-03
前言 以前一直做的是.net web工作,雖然做的不咋地,但是,感覺總算是個老手了,就想研究點新鮮玩意,而且一輩子不能只是做web吧,而且c++一直是我的夢想,c++是王者之選,我不做一做,死不瞑目啊! 今日我終於如願以償,從上一個公司已辭職,立即開始研究c++了,先是讓同事幫忙給點入門的例子,後來同事就到網上扒了一片文章中講述的IOCP的例子,太簡單,後來又找了一個,我不知道從哪裡入手加入My
Time of Update: 2018-12-03
using System.IO; using System.Xml; using System.Xml.Serialization; //序列化 yourType[] parms = Params; StreamWriter writer = new FileInfo("sample.xml").CreateText(); XmlSerializer serializer = new
Time of Update: 2018-12-03
//編譯引擎設計部分using System;using System.Text;using System.CodeDom.Compiler;using System.Reflection;using Microsoft.CSharp;namespace ToolPackages.CodeDomProvider{ public class SampleCodeDomProvider { //代碼產生器對象 private static
Time of Update: 2018-12-03
/*======================================================================== File: TypeResolve.cs Summary: This file implements "type resolution" sample. This sample demonstrates how hosts can participate in the type resolution
Time of Update: 2018-12-03
public enum 月定製項目 { [CustomItemAttribute()] 一點五元夜餐次數=1, [CustomItemAttribute()] 二元夜餐次數=2, [CustomItemAttribute()] 連班次數 =3, [CustomItemAttribute()] 甲類保健津貼次數 =4,
Time of Update: 2018-12-03
static void Main(string[] args) { decimal dValue = 400.5m; Console.WriteLine(Math.Round(dValue,0).ToString()); Console.WriteLine(RoundDecimal(dValue).ToString()); dValue = 40.5m;