知识点滴(一) c#副屏设置以及读写ini文件的方法
来源:互联网 发布:淘宝哪个店能寄到韩国 编辑:程序博客网 时间:2024/06/11 03:47
//获取屏幕集合 Screen[] screens = Screen.AllScreens; //读取ini文件 StringBuilder temp = new StringBuilder(500); string path = Application.StartupPath + @"\config\system.ini"; //副屏 XMLHelper.GetPrivateProfileString("system", "SecScreen", "", temp, 500, path); int iSecScreen = int.Parse(temp.ToString()); //副屏上一个屏 int iSecScreenPre = iSecScreen >= 1 ? iSecScreen - 1 : 0; //主屏 XMLHelper.GetPrivateProfileString("system", "MainScreen", "", temp, 500, path); int iMainScreen = int.Parse(temp.ToString()); //主屏上一个屏 int iMainScreenPre = iMainScreen >=1 ? iMainScreen - 1 : 0; //1、开启副屏 if (strisdual == "0" && screens.Length > 1) { OtherForm.Size = new Size(screens[iSecScreen].Bounds.Width, screens[iSecScreen].Bounds.Height); OtherForm.Left = iSecScreen == 0 ? 0 : screens[iSecScreenPre].Bounds.Width; //OtherForm.Left = screens[iSecScreen].Bounds.Left; this.Size = new Size(screens[iMainScreen].Bounds.Width, screens[iMainScreen].Bounds.Height); this.Left = iMainScreen == 0 ? 0 : screens[iMainScreenPre].Bounds.Width; } else { //nothing } /*扩展知识*/ //读取ini文件api [DllImport("kernel32")] public static extern int GetPrivateProfileString(string section, string key, string defVal, StringBuilder retVal, int size, string filePath); //写入ini文件api example: XMLHelper.WritePrivateProfileString("parameter", "port", this.txtport.Text, path); [DllImport("kernel32")] public static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
0 0
- 知识点滴(一) c#副屏设置以及读写ini文件的方法
- C#读写INI文件的方法
- c#读写INI文件方法
- 读写ini文件的方法
- ini文件的读写方法
- C#中读写INI文件的方法例子
- C#读写INI文件
- C#读写INI文件
- C#读写INI文件
- C#读写INI文件
- c#读写ini文件
- C#读写INI文件
- C#读写INI文件
- C# 读写ini文件
- c# 读写ini文件
- C#读写INI文件
- C#读写INI文件
- c#读写Ini文件
- HDU 1596 find the safest road(最短路变形)
- 图的存储方式
- Linux进程间通过pipe通信
- 使用ScrollView包裹布局,快速将布局变为可上下滑动
- 发送邮件页面
- 知识点滴(一) c#副屏设置以及读写ini文件的方法
- ural 1003 Parity 并查集
- 斑马打印机 password 处理
- Linux网络编程--协议的名称以及类型等处理
- Ibatis $与#的区别
- spring配置例子
- hdoj3001Travelling【状压dp 类TSP】
- compareHist函数
- Java ByteBuffer 使用实例