定義類的方法html
//要定義對象,必須有其相應的類。類就是描述一些具備相同屬性的事物的抽象概念。好比咱們定義一我的員類。以下 class Person { public string name; public int age; public string sex; public Person() { } } //而後定義這個類的對象。
定義一個數組web
int[] myIntArray; myIntArray = new int[5];
const int arraySize = 5; int[] myIntArray = new int[arraySize] { 5, 9, 10, 2, 99 };
動態長度數組sql
調用類的方法數據庫
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Exeplems { public class Class1 { public static void Method() { Console.WriteLine("靜態的方法能夠直接調用!可是很耗資源!"); } public void Method1() { Console.WriteLine("非靜態的方法要建立對象來訪問!"); } public void Method2() { Method1();//同一類中的方法體能夠直接訪問靜態和非靜態的 Method(); } } class Program { static void Main(string[] args) { Class1.Method();//訪問靜態方法 Class1 obj = new Class1();//建立對象 obj.Method1();//訪問非靜態方法;必須是public的 } } }
http://kooyee.iteye.com/blog/350017編程
int [ ][ ] b = new int [ 4][ ]; 最後的方括號內不寫入數字
b [ 0 ] = new int [ 4];
b [1 ] = new int [5]; --這幾行代碼是定義每一行中的元素的個數。
b [2 ] = new int [2];
b [ 0][ 1] = 10; ---賦值。
C#數組有關知識c#
C# 自定義類型的數組與 Array 類 -- Jakrely 技術文摘
http://www.jakrely.com/csharp-custom-type-array-and-array-class.html數組
C#數字格式化編程語言
C#數字格式化 - 飛雲若雪 - 博客園
http://www.cnblogs.com/sydeveloper/archive/2012/08/27/2657824.htmlide
C#中Dictionary的用法_百度經驗
http://jingyan.baidu.com/article/9989c7460ab872f648ecfeed.html工具
採用了NPlot的第三方庫
首先在工具欄導入dll文件,而後在可視化編輯區域拖動加入一個繪圖容器,系統會爲你建立下面的代碼
private NPlot.Windows.PlotSurface2D plotSurface2D1; // // plotSurface2D1 // this.plotSurface2D1.AutoScaleAutoGeneratedAxes = false; this.plotSurface2D1.AutoScaleTitle = false; this.plotSurface2D1.BackColor = System.Drawing.SystemColors.ControlLightLight; this.plotSurface2D1.DateTimeToolTip = false; this.plotSurface2D1.Legend = null; this.plotSurface2D1.LegendZOrder = -1; this.plotSurface2D1.Location = new System.Drawing.Point(238, 24); this.plotSurface2D1.Name = "plotSurface2D1"; this.plotSurface2D1.RightMenu = null; this.plotSurface2D1.ShowCoordinates = true; this.plotSurface2D1.Size = new System.Drawing.Size(523, 272); this.plotSurface2D1.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.plotSurface2D1.TabIndex = 1; this.plotSurface2D1.Text = "plotSurface2D1"; this.plotSurface2D1.Title = ""; this.plotSurface2D1.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plotSurface2D1.XAxis1 = null; this.plotSurface2D1.XAxis2 = null; this.plotSurface2D1.YAxis1 = null; this.plotSurface2D1.YAxis2 = null;
介紹使用NPlot的博客
http://www.cnblogs.com/zeroone/archive/2012/11/04/2753304.html
http://www.cnblogs.com/sky1991/archive/2012/09/26/2703347.html
須要更新plot的時候,能夠用一個屬性,每次更改數據源,並進行clear和refresh操做
選擇事件中能夠得到選中的節點Node
Node中有深度Level和序號Index的屬性,能夠知道選中的Node的位置。也能夠得到其Text屬性
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { Console.WriteLine("abc{0}"+e.Node.Text,sender); e.Node.TreeView.ExpandAll(); Console.WriteLine("get index {0} in level {1}", e.Node.Index,e.Node.Level); // e.Node.TreeView[1] //Console.WriteLine("upper level" + e.Node.Parent.Text);//e.Node.PrevVisibleNode.Text }
C#讀取DBF格式的數據表 - Tsybius2014 - 開源中國社區
http://my.oschina.net/Tsybius2014/blog/278426
C# 讀取dbf文件中的數據到datatable中 - C#編程語言程序開發技術文章_C#編程 - 紅黑聯盟
http://www.2cto.com/kf/201311/255404.html
本身寫的一段連接數據庫的代碼,是一個button的點擊事件,用來測試比較方便
private void button2_Click(object sender, EventArgs e) { Console.WriteLine("start db read method"); try { string table = @"E:\test\data.dbf";//dbf文件路徑 string sql = @"select * from " + table; OleDbConnection conn = new OleDbConnection("Provider=VFPOLEDB.1;" + "Data Source="+table+";"); conn.Open(); OleDbDataAdapter odda = new OleDbDataAdapter(sql, conn); DataTable dt = new DataTable(); odda.Fill(dt); Console.WriteLine("data table is {0}", dt.ToString()); MessageBox.Show("讀取完畢,查詢結果共計: " + dt.Rows.Count + " 條"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
microsoft 的資料
OleDbConnection 類 (System.Data.OleDb)
https://msdn.microsoft.com/zh-cn/library/system.data.oledb.oledbconnection(VS.80).aspx
輸出到系統剪切板,方便調試
string outString = ""; for (int i = 0; i < kLineData.CloseData.Count; i++) {
double close = kLineData.CloseData.ElementAt(i); outString = outString + System.Environment.NewLine + close; Console.WriteLine("number at {0}{1}", i, close); } outString = outString + System.Environment.NewLine + System.Environment.NewLine + System.Environment.NewLine; for (int i = 0; i < MAList.Count; i++) { outString = outString + System.Environment.NewLine+MAList.ElementAt(i); } outString = outString + System.Environment.NewLine + System.Environment.NewLine + System.Environment.NewLine; for (int i = 0; i < MAList.Count; i++) { outString = outString + System.Environment.NewLine + upList.ElementAt(i); }
Clipboard.SetText(outString);