02 2021 档案

摘要:例如:如果使用命令“dir”连续查询三次目录信息: String command = "dir" ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.UseShellExecute = false; // 需要对进程执行读写流 阅读全文
posted @ 2021-02-22 17:34 蜜铀 阅读(1747) 评论(0) 推荐(0)
摘要:这里是压缩代码,后面是拆解说明。 执行且不读取流 String cmd = "dir"; Process process = new System.Diagnostics.Process() { StartInfo = new System.Diagnostics.ProcessStartInfo( 阅读全文
posted @ 2021-02-22 14:07 蜜铀 阅读(1232) 评论(0) 推荐(0)
摘要:要求:年龄不满18 就边框飘红 后台代码: public class AgeInfoWithValidation : IDataErrorInfo { public int Age { get; set; } public string this[string columnName] { get { 阅读全文
posted @ 2021-02-08 13:48 蜜铀 阅读(127) 评论(0) 推荐(0)
摘要:实现简单的年龄划分: 如果年龄小于18则显示:年龄:x,未成年人; 否则:年龄:x,成年人; 代码: [ValueConversion(typeof(int), typeof(String))] public class AgeConverter : IValueConverter { public 阅读全文
posted @ 2021-02-08 11:53 蜜铀 阅读(103) 评论(0) 推荐(0)
摘要:验证用户是否年满18+ public class AgeRule : ValidationRule { private Double limitAge = 18; public Double LimitAge { get { return limitAge; } set { limitAge = v 阅读全文
posted @ 2021-02-08 11:35 蜜铀 阅读(218) 评论(0) 推荐(0)
摘要:代码如下: DataTemplate :使用黄色着色 ControlTemplate : 使用蓝色着色 <Button Content="Button"> <Button.ContentTemplate > <DataTemplate> <Label Background="Yellow" Cont 阅读全文
posted @ 2021-02-07 16:47 蜜铀 阅读(54) 评论(0) 推荐(0)