C#中遇到的方法总结

1、Select(string filterExpression, string sort)  // 获取按照指定的排序顺序且与筛选条件相匹配的所有 System.Data.DataRow 对象的数组。

2、Substring(param1,param2)  // 前一个是字符串起始位置,后一个是长度。

3、System.AppDomain.CurrentDomain.BaseDirectory  // 获取程序的基目录。
4、System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName  // 获取模块的完整路径,包含文件名
5、System.Environment.CurrentDirectory  // 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。
6、System.IO.Directory.GetCurrentDirectory()  // 获取应用程序的当前工作目录,注意工作目录是可以改变的,而不限定在程序所在目录。
7、System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase  // 获取和设置包括该应用程序的目录的名称。
8、System.Windows.Forms.Application.StartupPath  // 获取启动了应用程序的可执行文件的路径。

posted @ 2019-04-18 09:25  mrferry  阅读(130)  评论(0编辑  收藏  举报