01 2014 档案

摘要:从本地加载图片 public class OpenPictureCommand : Command { protected override void Executed(object sender, ExecutedRoutedEventArgs e) { System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog(); //EventBinder.BindControl... 阅读全文
posted @ 2014-01-29 15:02 quietwalk 阅读(2133) 评论(0) 推荐(0) 编辑
摘要:public void getMedicationAndEncounterInfo() throws Exception { String sql = getParameter("sql"); if (sql == null || sql.trim().length() > list = new MedicationDAO() .getMedicationAndEncounterInfo(sql); List medicationList = list != null && list.size() > 0 ?... 阅读全文
posted @ 2014-01-27 18:31 quietwalk 阅读(259) 评论(0) 推荐(0) 编辑
摘要:request 对象获取客户端提交的汉字字符时,会出现乱码问题,所以对含有汉字字符的信息必须进行特殊处理。将获取的字符串用 ISO-8859-1 进行编码,并将编码存放到一个字节数组中,再将这个数组转化这字符串对象即可。String str=request.getParameer("girl");byte b[]=str.getBytes("ISO-8859-1");str=new String(b); 阅读全文
posted @ 2014-01-23 20:54 quietwalk 阅读(480) 评论(0) 推荐(0) 编辑
摘要:style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word"语法: word-break : normal | break-all | keep-all 参数: normal : 依照亚洲语言和非亚洲语言的文本规则,允许在字内换行 break-all : 该行为与亚洲语言的normal相同。也允许非亚洲语言文本行的任意字内断开。该值适合包含一些非亚洲文本的亚洲文本 keep-all : 与所有非亚洲语言的normal相同。对于中文,韩文,日文,不允许字断开。适合包含少量亚洲文本的非亚洲文本 阅读全文
posted @ 2014-01-23 20:51 quietwalk 阅读(622) 评论(0) 推荐(0) 编辑
摘要:public List searchTplReleaseById(TplRelease tr)throws Exception{ DBOperator dbo = getDBOperator(); try{ List tplReleaseList = new ArrayList(); String sqlWhere = "select b.* from "+ "(SELECT max(a.CREATE_TIME) AS CREATE_TIME , a.TPL_ID ... 阅读全文
posted @ 2014-01-23 20:49 quietwalk 阅读(454) 评论(0) 推荐(0) 编辑
摘要:public int searchProblemDistinctCount() throws Exception { DBOperator dbo = getDBOperator(); try { PatientproblemTableAdapter adapter = new PatientproblemTableAdapter(dbo); PreparedStatement st = dbo.prepareStatement("select distinct patientid from " ... 阅读全文
posted @ 2014-01-23 20:46 quietwalk 阅读(417) 评论(0) 推荐(0) 编辑
摘要:Java: public List searchAccountingdisclosuresBySql(String sqlStr)throws Exception { DBOperator dbo = getDBOperator(); try { AccountingdisclosureTableAdapter adapter = new AccountingdisclosureTableAdapter(dbo); return adapter.select(sqlStr); } catch (Exce... 阅读全文
posted @ 2014-01-23 20:45 quietwalk 阅读(414) 评论(0) 推荐(0) 编辑
摘要:UUID.randomUUID().toString() 阅读全文
posted @ 2014-01-23 20:43 quietwalk 阅读(1071) 评论(0) 推荐(0) 编辑
摘要:private static SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS");webBrowserURL.setCreatedate(sdf.format(new Date()));import java.util.Date; 阅读全文
posted @ 2014-01-23 20:42 quietwalk 阅读(3662) 评论(0) 推荐(0) 编辑
摘要:正确写法1 bool bTemplatecontent2 = strtemplateContentInDB.Equals(strTemplateContentInDesignPanel, StringComparison.Ordinal); bTemplatecontent2 = true;正确写法2bool bEqual = String.Equals(strtemplateContentInDB, strTemplateContentInDesignPanel, StringComparison.Ordinal);bEqual = true; 阅读全文
posted @ 2014-01-23 20:41 quietwalk 阅读(1103) 评论(0) 推荐(0) 编辑
摘要:• 浮点数不能直接用算数操作符比较大小,如:==, !=, >=, <= operators and Equals 方法,要用以下形式:Math.Abs(x - y) < Single.Epsilon;Single.Epsilon 字段表示大于零的最小正 Single 值。此字段为常数。 Double.Epsilon 字段 表示大于零的最小正 Double 值。此字段为常数。 阅读全文
posted @ 2014-01-23 20:40 quietwalk 阅读(2080) 评论(0) 推荐(0) 编辑
摘要:bool Double.TryParse(string, out double)Int32.TryParse string strInt="37"; int iOut; if (Int32.TryParse(strInt, out iOut)) { int iRet = iOut; }double.TryParse string strNumber = "123"; double dRet; if (doub... 阅读全文
posted @ 2014-01-23 20:38 quietwalk 阅读(1379) 评论(0) 推荐(0) 编辑
摘要:如果用foreach,会造成被遍历的集合更改后带来异常问题。方法一:用for循环可有效的解决这个问题。for(int i=0;i newlists=new List();foreach(T t in List){ lists.add(t);}foreach(T t in newlists){ List.Remove(t);} 阅读全文
posted @ 2014-01-23 20:37 quietwalk 阅读(1948) 评论(0) 推荐(0) 编辑
摘要:out: 也是通过引用传值,但不需初始化ref 参数 :迫使值参数通过引用传送对于ref传参,只要记住一点:对于值类型来说传的是值的地址,对于引用类型来说传的是地址的地址。对于引用类型,同样记住一点:引用类型本身的地址是一个值类型。直观的理解:引用类型对象本身不改变,只改变对象的属性时,我们在操作同一个对象;如果连对象本身都可能会改变,就用ref传引用类型的对象吧! 阅读全文
posted @ 2014-01-23 20:36 quietwalk 阅读(143) 评论(0) 推荐(0) 编辑
摘要:C#的一个新特征是也可以给类编写无参数的静态构造函数。这种构造函数只执行一次,而前面的构造函数是实例构造函数,只要创建类的对象,就会执行它。 1.编写静态构造函数的一个原因是,类有一些静态字段或属性,需要在第1次使用类之前,从外部源中初始化这些静态字段和属性。2..Net 运行库没有确保什么时候执行静态构造函数,所以不应把要求在某个特定时刻(例如,加载程序集时)执行的代码放在静态构造函数中。也不能预计不同类的静态构造函数按照什么顺序执行。但是,可以确保静态构造函数至多运行一次,即在代码引用类之前调用它。在唧中,通常在第一次调用类的任何成员之前执行静态构造函数。3.静态构造函数没有访问修饰符,其 阅读全文
posted @ 2014-01-23 20:34 quietwalk 阅读(1615) 评论(0) 推荐(0) 编辑
摘要://WCF service: string servicePath = System.Web.Hosting.HostingEnvironment.MapPath("~"); //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug\ string strBaseDirectory = System.AppDomain.CurrentDomain.BaseDirectory; //F:\WorkSpace\EHR\src\vs2010\EHR\EHR\bin\Debug\EHR.vshost... 阅读全文
posted @ 2014-01-23 20:33 quietwalk 阅读(2526) 评论(0) 推荐(0) 编辑
摘要:1.序列化 public static byte[] SerializeObject(object obj) { if (obj == null) return null; MemoryStream ms = new MemoryStream(); BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(ms, obj); ms.Position = 0; ... 阅读全文
posted @ 2014-01-23 20:32 quietwalk 阅读(4025) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Runtime.Serialization.Formatters.Binary;using System.Security.Cryptography;using System.Text;//xlding, 2013/07/25namespace Gemr.Utils{ public class CommonAlgorithms { #region Sort public ... 阅读全文
posted @ 2014-01-23 20:29 quietwalk 阅读(2182) 评论(0) 推荐(0) 编辑
摘要:ObservableCollection oc = new ObservableCollection();ls.ForEach(x => oc.Add(x)); 阅读全文
posted @ 2014-01-23 20:28 quietwalk 阅读(268) 评论(0) 推荐(0) 编辑
摘要:List list = patientmains.OrderBy(p => p.Firstname).ThenBy(p => p.Middlename).ThenBy(p => p.Lastname).ToList(); 阅读全文
posted @ 2014-01-23 20:26 quietwalk 阅读(197) 评论(0) 推荐(0) 编辑
摘要:private void Test() { List lsA = new List(); lsA.Add("A"); lsA.Add("B"); lsA.Add("C"); lsA.Add("D"); List lsB = new List(); lsB.Add("C"); lsB.Add("D"); lsB.Add("E"); lsB.Add("F"); ... 阅读全文
posted @ 2014-01-23 20:25 quietwalk 阅读(470) 评论(0) 推荐(0) 编辑
摘要:public List GetViews() where V : View { var views = from item in dockLayoutManager1.GetItems() where item is LayoutPanel && ((LayoutPanel)item).Content.GetType() == typeof(V) select ((LayoutPanel)item).Content as V; return v... 阅读全文
posted @ 2014-01-23 20:24 quietwalk 阅读(102) 评论(0) 推荐(0) 编辑
摘要:Dictionary 的几种遍历方法Dictionarydic = newDictionary();方法1foreach (var item in dic){Console.WriteLine(dic.Key + dic.Value);}方法2//KeyValuePairforeach (KeyValuePair kv in dic){Console.WriteLine(kv.Key + kv.Value);}方法3//通过键的集合取foreach (string key indic.Keys){Console.WriteLine(key + list[key]);} 阅读全文
posted @ 2014-01-23 20:23 quietwalk 阅读(318) 评论(0) 推荐(0) 编辑
摘要:public static StringBuilder GetProperties(object obj) { if (obj == null) return null; Type t = obj.GetType(); PropertyInfo[] propertyInfo = t.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic); StringBuilder sb = ne... 阅读全文
posted @ 2014-01-23 20:22 quietwalk 阅读(172) 评论(0) 推荐(0) 编辑
摘要:DateTime.Now.ToUniversalTime().ToString("yyMMddHHmmss"); 阅读全文
posted @ 2014-01-23 20:21 quietwalk 阅读(262) 评论(0) 推荐(0) 编辑
摘要:SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );Date dateExecute = sdf.parse(executeDate );Calendar calendar = Calendar.getInstance();calendar.setTime(dateExecute);calendar.add(calendar.DATE,1);String dateStr = sdf.format(calendar.getTi 阅读全文
posted @ 2014-01-23 20:17 quietwalk 阅读(3695) 评论(0) 推荐(0) 编辑
摘要:提问地址:http://apps2.nlm.nih.gov/medlineplus/contact/index.cfm?lang=en&from=http://www.nlm.nih.gov/medlineplus/connect/emaillist.htmlSearching just by name or the combination of names (2014/01/20)We have use the web application to cite Medline Plus searching result page in our application, and it w 阅读全文
posted @ 2014-01-23 20:15 quietwalk 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 20:10 quietwalk 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 20:08 quietwalk 阅读(169) 评论(0) 推荐(0) 编辑
摘要:MaskType="RegEx" MaskUseAsDisplayFormat="True" Mask="[0-9]*"<dxe:TextEdit MaskType="Numeric" EditValue="{Binding Path=RowData.Row.TotalPrice}" 阅读全文
posted @ 2014-01-23 20:07 quietwalk 阅读(3634) 评论(0) 推荐(0) 编辑
摘要:StackPanel 的 HorizontalAlignment 属性和 VerticalAlignment 属性 默认情况下,这两个属性都被设置为 Stretch. 阅读全文
posted @ 2014-01-23 20:06 quietwalk 阅读(163) 评论(0) 推荐(0) 编辑
摘要:1.删除 Width 和 Height 属性;2.将 Windows.SizeToContent 属性设置为 WidthAndHeight这时窗口就能自动调整自身大小,从而容纳所包含的内容。通过将 Windows.SizeToContent 属性设置为 Width 或 Hight ,可以使窗口只能在一个方向上改变自身大小。 阅读全文
posted @ 2014-01-23 20:04 quietwalk 阅读(7954) 评论(1) 推荐(2) 编辑
摘要:Border: Button: 使用 ButtonChrome 装饰元素获取特有的圆角和阴影背景效果。ListBox 使用 ListBoxChrome 装饰元素。 阅读全文
posted @ 2014-01-23 20:03 quietwalk 阅读(269) 评论(0) 推荐(0) 编辑
摘要:*.GridSplitter属性是Grid面板的一个特性。(1)预留一行或一列,专门用于放置 GridSplitter对象,如果是行的话,把其Height 设置为 Auto,如果是列的话,把其 Width 设置为 Auto。(2)拉伸整行或整列,使其穿越整行或整列;使用RowSpan或ColumnSpan;(3)为 GridSplitter 设置最小尺寸,垂直分隔的话,设置 Width 为一个固定值,并将VerticalAlignment="Stretch";水平分隔的话,设置Height 为一个固定值,并将 HorizontalAlignment="Stretc 阅读全文
posted @ 2014-01-23 19:59 quietwalk 阅读(199) 评论(0) 推荐(0) 编辑
摘要:#依赖属性的用法与普通属性相同;#只能为依赖对象(继承自 DenpendencyObject的类)1)定义public static readonly DependencyProperty XXXProperty; 阅读全文
posted @ 2014-01-23 19:58 quietwalk 阅读(190) 评论(0) 推荐(0) 编辑
摘要:tbName.SetValue(Grid.RowProperty, 1); 阅读全文
posted @ 2014-01-23 19:57 quietwalk 阅读(338) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:57 quietwalk 阅读(2901) 评论(0) 推荐(0) 编辑
摘要:(1)img.MouseUp+= img_MouseUp;(2)调用 UIElement.AddHandler()直接连接事件;img.AddHandler(Image.MouseUpEvent, new MouseButtonEventHandler(img_MouseUp));(3)使用定义事件的类的名称,而不是引发事件的类的名称;img.AddHandler(UIElement.MouseUpEvent, new MouseButtonEventHandler(img_MouseUp));缺点:不能很明确地指明事件是由Image类提供的 阅读全文
posted @ 2014-01-23 19:55 quietwalk 阅读(258) 评论(0) 推荐(0) 编辑
摘要:1.Set the TabIndex="16"2. private void detailGrid_Keydown(object sender, KeyEventArgs e) { try { if (e.Key == Key.Enter) { TraversalRequest request = new TraversalRequest(FocusNavigationDirection.Next); ... 阅读全文
posted @ 2014-01-23 19:54 quietwalk 阅读(2983) 评论(0) 推荐(1) 编辑
摘要:this.tbContent.Document.Blocks.Clear(); 阅读全文
posted @ 2014-01-23 19:53 quietwalk 阅读(753) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:52 quietwalk 阅读(1152) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 19:51 quietwalk 阅读(211) 评论(0) 推荐(0) 编辑
摘要:1.用在textbox等输入控件上,验证输入是否合法。首先定义一个Converter,2.Xaml里面这样子写,意思是输入的数字,如果小于100则显示为红色。3.combox等列表控件里面,也可以用做数据筛选。下面例子中筛选出小于100的项目,红色显示数据源定义为:Xaml: 阅读全文
posted @ 2014-01-23 19:50 quietwalk 阅读(2038) 评论(0) 推荐(0) 编辑
摘要:1.定义一个全局资源文件,如下 2.使用1)引入命名空间:2)控件上使用 阅读全文
posted @ 2014-01-23 19:46 quietwalk 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 19:40 quietwalk 阅读(338) 评论(0) 推荐(0) 编辑
摘要:int iGroupRowHandle = this.gridControlView.FocusedRowHandle; if (iGroupRowHandle 0) { int childRowHandle = this.gridControl.GetChildRowHandle(iGroupRowHandle,0); if (childRowHandle > -1) { object... 阅读全文
posted @ 2014-01-23 19:39 quietwalk 阅读(1106) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 19:38 quietwalk 阅读(1854) 评论(0) 推荐(0) 编辑
摘要:在分组排序的基础上加上: 阅读全文
posted @ 2014-01-23 19:36 quietwalk 阅读(186) 评论(0) 推荐(0) 编辑
摘要:方法一:纯代码this.list.gridControl.ItemsSource = lsItem; this.list.gridControl.GroupBy("GroupTitle"); this.list.gridControl.Columns["GroupTitle"].SortOrder = ColumnSortOrder.Descending; //this.list.gridControl.SortBy(this.list.gridControl.Columns["GroupTitle"],... 阅读全文
posted @ 2014-01-23 19:34 quietwalk 阅读(1776) 评论(0) 推荐(0) 编辑
摘要:private DispatcherTimer _timer; private void SetTimeElaspInStatusBar() { try { _timer = new DispatcherTimer(); _timer.Tick += (sender, e) => { DateTime dtNow = DateTime.Now; ... 阅读全文
posted @ 2014-01-23 19:31 quietwalk 阅读(358) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:26 quietwalk 阅读(674) 评论(0) 推荐(0) 编辑
摘要:DisplayMember="ComboItemName" ValueMember="ComboItemCode"IsTextEditable="True" 是否可修改ValidateOnTextInput="False" 输入时不验证 阅读全文
posted @ 2014-01-23 19:25 quietwalk 阅读(198) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:24 quietwalk 阅读(979) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:22 quietwalk 阅读(1423) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:19 quietwalk 阅读(1282) 评论(0) 推荐(0) 编辑
摘要:1)定义模板资源 2)使用模板资源 阅读全文
posted @ 2014-01-23 19:12 quietwalk 阅读(1715) 评论(0) 推荐(1) 编辑
摘要:1)可以使绑定控件与基础数据源保持同步2)还可以在您添加、删除、移动、刷新或替换集合中的项目时引发 CollectionChanged 事件3)还可以在您的窗口以外的代码修改基础数据时做出反应4)相互转换T tList = new List(tObjectStruct .ToList()); ObservableCollection tObjectStruct = new ObservableCollection(tList); 都在构造函数中即可完成也可以:tList.ForEach(p => tObjectStruct.Add(t)); ObservableCollection类的. 阅读全文
posted @ 2014-01-23 19:09 quietwalk 阅读(1274) 评论(0) 推荐(0) 编辑
摘要:private void ruleListView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ListViewItem item = Utilities.GetVisualParent((UIElement)Mouse.DirectlyOver); if (item == null) return; Cdsrule rule = item.Content as Cdsrule; if (rule != null) ... 阅读全文
posted @ 2014-01-23 19:08 quietwalk 阅读(1186) 评论(0) 推荐(0) 编辑
摘要:1)根据名称查找 PrintPreview fe = new PrintPreview(new Summary()); string strResourceHeader = "headerStyle" + styleSize.ToString(); HeaderStyle = (Style)fe.FindResource(strResourceHeader);2)根据名称直接获取 Style baseStyle = this.Resources["gridRowStyle"] as Style; 阅读全文
posted @ 2014-01-23 19:06 quietwalk 阅读(345) 评论(0) 推荐(0) 编辑
摘要:OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "All Files (*.*)|*.*"; dialog.Multiselect = false; if (dialog.ShowDialog() == true) { txtKeyPath.Text = dialog.FileName; } 阅读全文
posted @ 2014-01-23 19:05 quietwalk 阅读(229) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 19:04 quietwalk 阅读(288) 评论(0) 推荐(0) 编辑
摘要:&lt; &gt; = &lt;= &gt;= &lt;&gt; 阅读全文
posted @ 2014-01-23 19:03 quietwalk 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 19:02 quietwalk 阅读(3830) 评论(0) 推荐(0) 编辑
摘要:1)由控件获取内容:ListViewItem item = Utilities.GetVisualParent(chx); if (item == null) return; ListView2.SelectedItems.Clear(); item.IsSelected = true; Outpatient outpatient = item.Content as Outpatient;2) Patientappointment appointment = ListView... 阅读全文
posted @ 2014-01-23 19:01 quietwalk 阅读(239) 评论(0) 推荐(0) 编辑
摘要:private void ListView1_MouseMove(object sender, MouseEventArgs e) { Patientappointment appointment = ListView1.SelectedItem as Patientappointment; if (appointment != null) { SelectedAppointment = appointment; if (e.LeftButton == ... 阅读全文
posted @ 2014-01-23 19:00 quietwalk 阅读(501) 评论(0) 推荐(0) 编辑
摘要:1.GetVisualParentpublic static T GetVisualParent(DependencyObject obj) where T : DependencyObject{DependencyObject parent = obj;while (true){if (parent == null) return null;T t = parent as T;if (t != null) return t;parent = VisualTreeHelper.GetParent(parent);}}使用示例代码: Button btn = sender as Button; 阅读全文
posted @ 2014-01-23 18:59 quietwalk 阅读(565) 评论(0) 推荐(0) 编辑
摘要:... 阅读全文
posted @ 2014-01-23 18:56 quietwalk 阅读(740) 评论(0) 推荐(0) 编辑
摘要:PickPatientReminderTableDialog dialog = new PickPatientReminderTableDialog(); dialog.Owner = Application.Current.Windows.Cast().SingleOrDefault(x => x.IsActive); 阅读全文
posted @ 2014-01-23 18:54 quietwalk 阅读(378) 评论(0) 推荐(0) 编辑
摘要:private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { TextBox textBox = sender as TextBox; TextChange[] change = new TextChange[e.Changes.Count]; e.Changes.CopyTo(change, 0); int offset = change[0].Offset; if (change[0... 阅读全文
posted @ 2014-01-23 18:53 quietwalk 阅读(637) 评论(0) 推荐(0) 编辑
摘要:1)不应当设置硬编码的高度,这样不能适应不同的字体大小,并且可能导致布局问题。2)可以使用方便的 MinLines和 MaxLines属性,设置在文本框中必须显示的最小行数。3)从代码中,可以检查 LineCount 属性准确地获取文本框中一共有多少行。4)在文本内容中移动:LineUp(); LineDown(); PageUp(); PageDown(); ScrollToHome();ScrollToEnd(); ScrollToLine 阅读全文
posted @ 2014-01-23 18:52 quietwalk 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 18:51 quietwalk 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-01-23 18:49 quietwalk 阅读(410) 评论(0) 推荐(0) 编辑
摘要:获取主窗口的引用:Window main=Application.Current.MainWindow获取程序中打开的所有窗口:Application.Currrent.Windows(在一个自定义应用程序类中保存那些需要用到的窗口的引用可能更有意义) 阅读全文
posted @ 2014-01-23 18:49 quietwalk 阅读(133) 评论(0) 推荐(0) 编辑
摘要:/// /// AsynchronousLoading class /// public static class AsynchronousLoading { /// /// AsyncInvokeHandler delegate /// /// object public delegate object AsyncInvokeHandler(); /// /// AsyncInvokeCallbackHandler /// ... 阅读全文
posted @ 2014-01-23 18:48 quietwalk 阅读(683) 评论(0) 推荐(0) 编辑
摘要:Step 1在WPF的C#代码文件中给定义复杂类型的变量,并给其赋值;Sample code: ListlsUser=。。。。Setp 2在 C#代码对应的XAML 中将此复杂参数定义为资源;Sample code: ...这里的命名空间 C 是你的复杂参数所在的命名空间;Step 3 Step 4 Converter 里对参数的使用public class UserNameConverter : IValueConverter { public object IValueConverter.Convert(object value, Type tar... 阅读全文
posted @ 2014-01-23 18:46 quietwalk 阅读(376) 评论(0) 推荐(0) 编辑
摘要:public static string GetSHA1Method(string strSource) { string strResult = ""; //Create System.Security.Cryptography.SHA1 sha = System.Security.Cryptography.SHA1.Create(); byte[] bytResult = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(strSour... 阅读全文
posted @ 2014-01-23 12:44 quietwalk 阅读(1893) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Text;using System.Net.Mail;using System.Net;using System.IO;namespace Haitai{ public class EmailClient { public EmailClient(string host, int port, bool enableSsl, string username, string password) { _host = hos... 阅读全文
posted @ 2014-01-23 12:12 quietwalk 阅读(253) 评论(0) 推荐(0) 编辑
摘要:private DispatcherTimer _timer; private void SetTimeElaspInStatusBar() { try { _timer = new DispatcherTimer(); _timer.Tick += (sender, e) => { DateTime dtNow = DateTime.Now; TimeSpan interval = dtNow - _enterSystemTime; this.barElapsedTime.Content = null; #region TimeZoneInfo currentTimeZone = Ti 阅读全文
posted @ 2014-01-23 12:06 quietwalk 阅读(1217) 评论(0) 推荐(0) 编辑
摘要:Network Time Protocol互联网时间协议NTP is intended tosynchronizeall participating computers to within a few milliseconds ofCoordinated Universal Time(UTC).[1]:3It uses a modified version ofMarzullo's algorithmto select accurate time servers and is designed to mitigate the effects of variablenetwork lat 阅读全文
posted @ 2014-01-20 11:17 quietwalk 阅读(3708) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示