Time of Update: 2016-08-12
標籤: hive odbc 驅動配置成功後,通過c#訪問就變得比較簡單了,分為查詢與更新操作,直接附上測試代碼。在此過程中需要注意c#工程編譯的目標平台讀寫存取碼樣本:public class HiveOdbcClient { /// <summary> /// /// </summary> public static HiveOdbcClient
Time of Update: 2016-08-25
標籤:1.什麼是Attribute?特性(Attribute)是用於在運行時傳遞程式中各種元素(比如類、方法、結構、枚舉、組件等)的行為資訊的聲明性標籤。您可以通過使用特性向程式添加聲明性資訊。一個聲明性標籤是通過放置在它所應用的元素前面的方括弧([ ])來描述的。特性(Attribute)用於添加中繼資料,如編譯器指令和注釋、描述、方法、類等其他資訊。.Net
Time of Update: 2016-08-25
標籤:誠意滿滿直接上代碼:static void Main(string[] args){ //Main函數中增加此句 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);}並在Program類(Main函數所在類)中,增加如下函數即可: private static void
Time of Update: 2016-08-24
標籤:時常我們會遇到檔案的複製、上傳等問題。特別是自動化生產方面,需要對機台拋出的檔案進行搬運、收集,然後對資料裡的資料等進行分析,等等。Winform下,列舉集中較常見的檔案的搬運。 1 private void MoveFile() 2 { 3 string Frompath = @"D:\Test\OutPut"; 4 string directoryPath = @"D:\report"; 5
Time of Update: 2016-08-24
標籤:對於建立PDF時,向PEF中插入圖片,座標比較不好控制,建議先在PDF裡畫表格,然後將圖片放至對應的表格即可。方法如下: 1 private void OutPutPDF() 2 { 3 string imagePath = GR_Path; //檔案路徑 4 string
Time of Update: 2016-08-23
標籤:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace MyExample_Hanoi_{ class Program { static void Main(string[] args)
Time of Update: 2016-08-23
標籤:文檔注釋是為了方便自己和他人更好地理解代碼所實現的功能。下面記錄了一些常用的文檔注釋標記:<C>用法: <c>text</c> 將說明中的文本標記為代碼。例如:/// <summary>/// Validates the user./// </summary>/// <param name="username">The username.</param>/// <param
Time of Update: 2016-08-23
標籤: 建立字串 如果多次修改一個字串或建立一個很長的字串,用String類會效率低下。這種情況,可以用 System.Text.StringBuilder ,它專門為這種情況設計的。格式化運算式 格式化運算式使用兩個有效介面 IFormatProvider 和 IFormattable 。 這樣 Console.WriteLine 和 類似的類 以指定的方式顯示值。Regex 用
Time of Update: 2016-08-23
標籤:1.將解決方案配置裡面的“Debug”轉換成“Release” 2.右擊“解決方案”,選著“重建解決方案”,以得到最新的版本 3.找到工程目錄下的“bin”檔案夾,裡面有“Release”檔案夾,對此檔案夾進行壓縮,然後發送給需要的客戶就行了。 4.拿到壓縮檔後,進行解壓,找到工程裡面的“工程名.exe檔案
Time of Update: 2016-08-19
標籤:最近參加項目中,資料操作基本都是用DataTable的操作,老代碼中有些地方用到DataTable.Rows.Add又有些代碼用的DataTable.ImportRow,於是就對比了一下VS查詢說明:顯示//// 摘要: // 建立使用指定值的行,並將其添加到 System.Data.DataRowCollection 中。//// 參數: // values:// 用於建立新行的值的數組。//// 返回結果: // 無。//// 異常: //
Time of Update: 2016-08-19
標籤:最近對QQ聊天機器人比較感興趣,奈何一直沒找到C#的源碼,就自己摸索,好了廢話不多說了,開始正題。首先我們要準備的是C# 的SDK:https://cqp.cc/t-24088-1-1,Newtonsoft.Json.dll外掛程式開啟C#SDK源碼後找到MyApp.cs(QQ發送消模組) 在裡面找到QQ私聊訊息 HttpWebResponse Response = null; string result = null; String
Time of Update: 2016-08-19
標籤:轉載原地址 http://www.cnblogs.com/gjahead/archive/2008/02/28/1084871.htmlref和out的區別在C# 中,既可以通過值也可以通過引用傳遞參數。通過引用傳遞參數允許函數成員更改參數的值,並保持該更改。若要通過引用傳遞參數,
Time of Update: 2016-08-12
標籤: 在用寫一個案頭軟體的過程中,用到webbrowser實現介面。這時有一個禁止webbrowser通過f5按鍵進行重新整理的要求。本著邊做邊學的原則,本菜查了一下百度,原來這麼簡單,代碼如下:this.webBrowser1.WebBrowserShortcutsEnabled = false;
Time of Update: 2016-08-14
標籤:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms; namespace GetDeskDirectory{ public partial class Form1 :
Time of Update: 2016-08-12
標籤:# 題目4. Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3
Time of Update: 2016-08-11
標籤: System.Data.DataTable GetDataFromExcelByCom(bool hasTitle, string fileName) { //OpenFileDialog openFile = new OpenFileDialog(); //openFile.Filter = "Excel(*.xlsx)|*.xlsx|Excel(*.xls)|*.xls";
Time of Update: 2016-08-16
標籤:C#與.NET一、什麼是C#這裡的「#/?」讀作「sharp」,意思是「(Music, other) (immediately postpositive) denoting a note that has been raised in pitch by one chromatic semitone: B sharp. 」,也就是:一個升的調。有些開發看到別人讀「C 井(jǐng)」,一臉鄙視的樣子,也不給解釋,或許有些開發也不知道為什麼讀作「sharp」。 The
Time of Update: 2016-08-16
標籤:我使用的是vs20131、在項目中添加引用,項目->添加引用->COM選擇Microsoft Speech Object Library2、在需要使用語音合成的地方調用代碼:SpVoice voice = new SpVoice();voice.Voice = voice.GetVoices(string.Empty, string.Empty).Item(0);voice.Speak(this.textBox1.Text,
Time of Update: 2016-08-13
標籤:System.IO.Path.GetFullPath(openFileDialog1.FileName); //絕對路徑System.IO.Path
Time of Update: 2016-08-15
標籤:http://www.cnblogs.com/skynet/p/4173450.htmlNginx + CGI/FastCGI + C/Cpp2014-12-19 11:05 by