随笔分类 - C#
摘要:服务契约:namespace Contracts{ [System.ServiceModel.ServiceContract] public interface ICalculator { [System.ServiceModel.OperationContract] double Add(double ax, double bx); }}服务:namespace Service{ public class CalculatorService:ICalculator { public double Add(double ...
阅读全文
摘要:/// <summary> /// 获取取大值 /// </summary> /// <param name="a">P1值</param> /// <param name="b">P2值</param> /// <param name="c">P3值</param> /// <returns>float</returns> public float GetMaxValue(string a, string b, s
阅读全文
摘要:FTP简单管理代码。。在这个做个备注using System.Collections.Generic;using System.IO;namespace CommonSystemFrameWork.Storage{ public abstract class StorageProvider { public abstract List<string> List(string path); public abstract List<string> List(string path, string fillter); public abstra...
阅读全文
摘要:DevExpress 项目的默认是英文版本的。 版本必须在12.0以上在我们开发的时候以及发布给客户的时候 要改成中文版本。 System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-CN"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CN"); 在系统初...
阅读全文
摘要:DevComponents.DotNetBar 控件添加选项卡 同理 在这里做个备注。。。。。
阅读全文
摘要:在这里做个记录 防止忘记http://msdn.microsoft.com/en-us/library/cc716729.aspxOrcale:http://docs.oracle.com/cd/B28359_01/win.111/b28376/appendixa.htm//SQL 一些很好的国外网站:http://www.sqlteam.com/http://blog.sqlauthority.com/
阅读全文
摘要:在插件式开发。我们要调用其它插件或模块的委托事件时、那么我们需要通过反射。Module 模块namespace Module2{ /// /// MainWindow.xaml 的交互逻辑 /// [Plugin("MainWindow", "测试反射")] public partial class MainWindow { public delegate void TestHandler(string msg,string info,string text); public event TestHandler TestEv...
阅读全文
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.
阅读全文
摘要:在Winform或其它项目 有时候有很多老是在重复 有时候很麻烦。。那么我们将他做成模板、、打开VS2010、或其它版本新建一个项目:选择VS 文件 下面有个选项《导出模板》然后下一步:选择相应的图标,然后点击完成:模板制作完成:打开VS2010新建项目时你将会发现你的模板:然后项目将会是你的模板:制作完成然后我们将制作Forms 模板:#region Version Info /* * ======================================================================== * 【本类功能概述】 * 作者:芦永强 * 时间:$time$
阅读全文
摘要:interfacenamespace SQLLiteHelper{ /// <summary> /// 数据库操作抽象 /// </summary> public interface IDataAccess { /// <summary> /// 打开 /// </summary> void Open(); /// <summary> /// 关闭 /// </summary> void Close(); /// <summary> ...
阅读全文
摘要:在Winform。。TreeView绑定数据RoleManager tManager = new RoleManager(); DataTable dt = tManager.FindRoleRigthByRoleid(listRoleView.SelectedItems[0]...
阅读全文
摘要:Code 1 string filePath = @Environment.CurrentDirectory + "\\SimuAppClient.txt"; 2 if(!File.Exists(filePath)) 3 { 4 return; 5 } 6 var filest = new FileStream(filePath, FileMode.Open, FileAccess.ReadWrite); 7 using (var sr ...
阅读全文
摘要:StreamResourceInfo sri=Application.GetResourceStream( new Uri("stop.ani",UriKind.Relative)); Cursor customCurrsor=new Cursor (sri.Stream); this.Cursor=customCurrsor;Cursor对象不直接支持URI资源语法,通过该语法其它WPF元素(如Image对象)可以使用保存在编译过的程序集中的文件,然后。为应用程序添加光标文件作为资源,然后作为可以用于构造Cur...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace ThreadPoolDemo{ class Program { static void Main(string[] args) { int nWorkerThreads; int nCompletionPorteads; ThreadPool.GetMaxThreads(out nWorkerThreads, out nCompletionPorteads); Con
阅读全文
摘要:public string NumToChinese(string x) { //数字转换为中文后的数组 string[] P_array_num = new string[] { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; //为数字位数建立一个位数组 string[] P_array_digit = new string[] { &q
阅读全文
摘要:byte by1, by2; if (byte.TryParse(textBox1.Text, out by1) && byte.TryParse(textBox2.Text, out by2))//判断是否是 Byte类型 { try { checked { by1 += by2; textBox3.Text = by1.ToString(); } } catch (OverflowException ex)//溢出异常 { MessageBox.Show(ex.Message); } } else { MessageBox.Show("对不起!您输入的数字有问题!
阅读全文
摘要: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 SIMUHKNETSDK;namespace SIMUSDK{ public partial class Form1 : Form { private int m_videoHandle;//视频Handle ...
阅读全文
摘要:2012-06-05 /// /// 获取本地IP地址信息 /// void GetAddressIP() { ///获取本地的IP地址 string AddressIP = string.Empty; foreach (IPAddress _IPAddress in Dns.GetHostEntry(Dns.GetHostName()).AddressList) { if (_IPAddress.AddressF...
阅读全文
摘要:1 using System; 2 3 using System.Data; 4 5 using System.Text.RegularExpressions; 6 7 using System.Xml; 8 9 using System.IO; 10 11 using System.Collect
阅读全文