摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
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 阅读全文