⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settings.cs

📁 本论文叙述了联机考试系统的现状以及C#语言的概况。重点介绍了联机考试系统的实现过程:包括系统分析、 系统调查、 数据流程分析、功能设计、 数据库设计、 系统物理配置方案、 系统实现、 系统测试和调试。
💻 CS
字号:
using System;
using System.IO;


namespace SupermarketProject
{
	/// <summary>
	///Settings 的摘要说明。
	/// </summary>
	public class Settings
	{
		public string supermarketName, address, phone, fax, 
			mainDirectory, uiDirectory, appDirectory;
		public int maxUsers;
		public Settings()
		{
			this.appDirectory = Environment.CurrentDirectory; 
			this.mainDirectory = this.appDirectory;
			this.uiDirectory = this.appDirectory;

			try
			{
				StreamReader textStream = new StreamReader(mainDirectory + @"\Settings.txt",System.Text .Encoding .Default );
			
				supermarketName = textStream.ReadLine();
				textStream.ReadLine();
				string test;
				do
				{
					test = textStream.ReadLine();
					if (test.CompareTo("电话") < 0)
						address += test+"\n";
					else
						phone = test;
				}while (test.CompareTo("电话")< 0);		
				fax = textStream.ReadLine();				
				maxUsers = int.Parse(textStream.ReadLine() .Substring(6));
				DataConnection.database = textStream.ReadLine() .Substring(4);
					
			}
			catch(Exception e)
			{
				Console.WriteLine(e.Message );
			}
		}//构造函数结尾
	}//类结尾
}//名称空间结尾

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -