Markdown语法主要分为如下几大部分:
标题,段落,区块引用,代码区块,强调,列表,分割线,链接,图片,反斜杠 \
,符号'`'。
两种形式:
1)使用=
和-
标记一级和二级标题。
一级标题
=========
二级标题
---------
using Microsoft.Win32; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Security.Principal; | |
using System.Text; | |
using System.Threading.Tasks; |
public static bool IsDotNet35Installed() | |
{ | |
bool ret = false; | |
RegistryKey rk = OpenSoftwareKey(@"\Microsoft\NET Framework Setup\NDP\v3.5"); | |
if (rk != null) | |
{ | |
ret = true; | |
rk.Close(); | |
} |
public static void CopyDirectory(String sourcePath, String destinationPath) | |
{ | |
DirectoryInfo info = new DirectoryInfo(sourcePath); | |
Directory.CreateDirectory(destinationPath); | |
foreach (FileSystemInfo fsi in info.GetFileSystemInfos()) | |
{ | |
String destName = Path.Combine(destinationPath, fsi.Name); | |
if (fsi is System.IO.FileInfo) //如果是文件,复制文件 | |
File.Copy(fsi.FullName, destName); |
public static double ExtractDouble(this string str) | |
{ | |
Regex Reg = new Regex(@"[-+]?[0-9]*\.?[0-9]+"); | |
Match m = Reg.Match(str); | |
if (m.Success) | |
return Convert.ToDouble(m.Value); | |
else | |
return 0.0; | |
} |
public static List<T> FindControlByType<T>(this Control mainControl, bool getAllChild = false) where T : Control | |
{ | |
List<T> lt = new List<T>(); | |
for (int i = 0; i < mainControl.Controls.Count; i++) | |
{ | |
if (mainControl.Controls[i] is T) lt.Add((T)mainControl.Controls[i]); | |
if (getAllChild) lt.AddRange(FindControlByType<T>(mainControl.Controls[i], getAllChild)); | |
} | |
return lt; | |
} |
快捷键 | 说明 |
---|---|
Ctrl+- | 移动光标到上次位置或相反,比如定位一个函数,转到函数定义后想回到函数使用处,则用Ctrl+-,若又想回到函数定义处则可以按Shift+Ctrl+- |
Ctrl+] | 匹配选中的括号(大括号、小括号都行),在多层循环+判断语句时非常方便 |
Ctrl+Space | 代码补全 |
Ctrl+Tab | 在VS中切换打开的窗口,即切换各个文件 |
Ctrl+I | 递增搜索,与Ctrl+F不同的是搜索期间不显示搜索对话框,且Ctrl+F搜索下一个直接按Enter即可,而Ctrl+I搜索下一个按Ctrl+I或F3,Esc退出,连续按两次Ctrl+I重复上次搜索 |
Ctrl+Shift+F | 旧式的文件搜索对话框(与记事本中的搜索替换框差不多,可以替换) |
Ctrl+F3 | 为当前选中的部分进行搜索(不需要再输入要搜索的内容) |
Shift+Alt+Enter | 最大化代码编写区域(代码全屏模式),即去掉所有其它辅助窗口 只留下代码编写窗口,再按一次返回到原来界面 |
花不啰嗦,直接看代码,数据绑定到DataTable上,如果有多个控件绑定到一个DataTable上,你又不需要控件之间联动, | |
请添加类似“ddList.BindingContext = new BindingContext();”的代码。 | |
我看到国内很多人的帖子都是用的DataTable的Copy方法,在某些情况下能满足要求,如果DataTable数据是要变动的Copy | |
大法就GameOver了,还是多用内建的方法,很多功能微软都为我们考虑好了, 是我们自己学艺不精不甚了解罢了。 | |
========================================================================================================== | |
RadDropDownList ddList = new RadDropDownList(); | |
...............(其它属性设置省略) | |
ddList.BindingContext = new BindingContext(); | |
ddList.DataSource = FilesDataTable; |
public class ConsoleWriterEventArgs : EventArgs | |
{ | |
public string Value { get; private set; } | |
public ConsoleWriterEventArgs(string value) | |
{ | |
Value = value; | |
} | |
} | |
public class ConsoleWriter : TextWriter |