随笔分类 -  C#

摘要:double interval = (double)1 / (endIndex - startIndex); interval = Math.Round(interval , 2); 阅读全文
posted @ 2014-06-12 14:25 louiskoo 阅读(6163) 评论(0) 推荐(0)
摘要:__stdcall 要加这个extern "C" __declspec(dllexport)要用这样的东东 定义extern "C" __declspec(dllexport) void GetCallBack( callBackFun pfun){ g_pFun=pfun;} 阅读全文
posted @ 2013-10-28 21:42 louiskoo 阅读(338) 评论(0) 推荐(0)
摘要:bool System.Boolean 4Byte 32bit布尔型变量 逻辑值,true或者false,默认值为falsebyte System.Byte 1Byte 8bit无符号整数无符号的字节,所存储的值的范围是0~255,默认值为0sbyte System.SByte 1Byte8bit有符号整数带符号的字节,所存储的值的范围是-128~127,默认值为0char System.Char 2Byte 16bit 无符号Unicode字符,默认值为’... 阅读全文
posted @ 2013-10-23 16:17 louiskoo 阅读(258) 评论(0) 推荐(0)
摘要:private void chart2_MouseMove(object sender, MouseEventArgs e) { if (!this.DesignMode) { double newPosition = chart2.ChartAreas[0].AxisX.ScaleView.Position; chart用户来电.ChartAreas[0].AxisX.ScaleView.Scroll(newPosition); ScrollB... 阅读全文
posted @ 2013-10-11 10:57 louiskoo 阅读(1337) 评论(0) 推荐(0)
摘要: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.Threading;namespace WindowsFormsApplication1{ public partial class WelcomeForm : Form { public Wel... 阅读全文
posted @ 2013-10-10 16:22 louiskoo 阅读(984) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace FileSort{ class Program { //static void Main(string[] args) //{ //} public enum CharType { Number = 0, Normal = 1 ... 阅读全文
posted @ 2013-09-25 15:37 louiskoo 阅读(1891) 评论(0) 推荐(0)
摘要:1) Close your solution2) Tools->Options->"Windows Form Designer" - find AutoToolboxPopulate property in Toolbox category and set 'true'3) Open your solution. 阅读全文
posted @ 2013-09-23 10:51 louiskoo 阅读(732) 评论(0) 推荐(1)
摘要:Sandcastle Help File Builderhttp://shfb.codeplex.com/ 阅读全文
posted @ 2013-09-04 18:53 louiskoo 阅读(296) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/easyzikai/archive/2012/10/14/2723328.html 阅读全文
posted @ 2013-09-04 12:58 louiskoo 阅读(457) 评论(0) 推荐(0)
摘要:Invoke(new EventHandler(delegate { Bitmap bitmap2 = (Bitmap)eventArgs.Frame.Clone(); ThreadPool.QueueUserWorkItem(delegate { bitmap2.Save(@"G:\VCAP\" + last.T... 阅读全文
posted @ 2013-09-04 11:01 louiskoo 阅读(1159) 评论(0) 推荐(0)
摘要:方法一:Rectangle bounds = Screen.GetBounds(Point.Empty); using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size); ... 阅读全文
posted @ 2013-08-30 08:43 louiskoo 阅读(5613) 评论(0) 推荐(1)
摘要:static void Serialize(T instance , string fileName){ using(XmlWriter writer = new XmlWriter(filename , Encoding.UTF8)) { XmlSerializer serializer = new XmlSerializer(typeof(T)); serializer.Serialize(writer , instance); }}Serialize(order , "order.xml"); 阅读全文
posted @ 2013-07-30 20:47 louiskoo 阅读(1971) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace WaitOne{ class Program { static void Main(string[] args) { Calculate calc = new Calculate(); Console.WriteLine("Result = {0}.", calc.Res... 阅读全文
posted @ 2013-07-22 23:39 louiskoo 阅读(235) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace WaitOne{ class Program { static AutoResetEvent autoEvent = new AutoResetEvent(false); static void Main(string[] args) { Console.WriteLine("Main sta... 阅读全文
posted @ 2013-07-22 23:20 louiskoo 阅读(315) 评论(0) 推荐(0)
摘要:http://hi.baidu.com/yandavid/item/d66b1fe4a3e4c80f8d3ea80b?qq-pf-to=pcqq.group 阅读全文
posted @ 2013-07-10 20:14 louiskoo 阅读(309) 评论(0) 推荐(0)
摘要:实现思想:新建一个线程用来显示Form2,Form1的消息循环线程就可以结束了。private void Button1_MouseClick(object sender, MouseEventArgs e){ Thread t = new Thread(new ThreadStart(delegate { Application.Run(new Form2()); })); t.Start(); this.Dispose(true);} 阅读全文
posted @ 2013-06-12 20:46 louiskoo 阅读(496) 评论(0) 推荐(0)
摘要:FileStream fs = new FileStream(filePath , FileMode.Open , FileAccess.Read , FileShare.ReadWrite); StreamReader read = new StreamReader(fs); read.ReadToEnd(); read.Close(); fs.Close(); 阅读全文
posted @ 2013-05-22 17:05 louiskoo 阅读(194) 评论(0) 推荐(0)
摘要:var is_over = new ObjectParameter("ISOVER", typeof(string)); context.ExecuteFunction("AERO_STATUS_JUDGE", new ObjectParameter("AERO_ID", aero_id), is_over); string ret = is_over.Value.ToString();int K = context.ExecuteStoreCommand("delete from SRC_DEF_PLATFORM_AERO 阅读全文
posted @ 2013-05-13 16:42 louiskoo 阅读(564) 评论(0) 推荐(0)
摘要:/// <summary> /// 判断是否是非法字符 /// </summary> /// <param name="str">判断是字符</param> /// <returns></returns> public static Boolean isLegalNumber(string str) { char[] charStr = str.ToLower().ToCharArray(); for (int i = 0; i < charStr.Length; i... 阅读全文
posted @ 2013-05-13 16:31 louiskoo 阅读(5432) 评论(1) 推荐(0)
摘要:if (!File.Exists(path)) { File.Create(path).Close(); } using (StreamWriter w = File.AppendText(path)) { w.WriteLine("Error log:"); w.WriteLine("Error Time:"+DateTime.Now); ... 阅读全文
posted @ 2013-05-13 16:11 louiskoo 阅读(202) 评论(0) 推荐(0)