9. 如何获取应用程序当前执行的路径?(How to get the path to my running EXE?)
string appPath = Application.ExecutablePath;
10. 如何确定当前运行的系统?(How to determine which operating system is running?)
OperatingSystem os = Environment.OSVersion;
MessageBox.Show(os.Version.ToString());
MessageBox.Show(os.Platform.ToString());
11. 如何从完整的路径中获取文件名?(How to get a file ’s name from the complete path string?)
用System.IO.Path.GetFileName 和 System.IO.Path.GetFileNameWithoutExtension(无扩展名)的方法
12. 如何从完整的路径中获取文件扩展名?(How to get a file ’s extension from the complete path string?)
用System.IO.Path.GetExtension方法
13. 如何使没有选择日期的DateTimePicker控件为空文本?(How to make the DateTimePicker show empty text if no date is selected?)
dateTimePicker1.CustomFormat = \" \";
dateTimePicker1.Format = DateTimePickerFormat.Custom;
14. 如何在Report Viewer中隐藏Crystal Report的状态栏?(How to hide the status bar of Crystal Report in Report Viewer?) [Page]
foreach(object obj in this.crystalReportViewer1.Controls)
{
if( obj.GetType()== typeof(System.Windows.Forms.StatusBar))
{
StatusBar sBar=(StatusBar)obj;
sBar.Visible=false;
}
}
15. 如何利用Crystal Report程序来生成PDF版本?(How to generate PDF version of Crystal Report programmatically?)
Repor