You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							40 lines
						
					
					
						
							945 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							40 lines
						
					
					
						
							945 B
						
					
					
				
								using System;
							 | 
						|
								
							 | 
						|
								namespace EC.Utils.Storage
							 | 
						|
								{
							 | 
						|
									public class LocalStorage
							 | 
						|
									{
							 | 
						|
										private const string Section = "LocalStorage";
							 | 
						|
										private static IniFileHelper _iniFile;
							 | 
						|
								
							 | 
						|
										public static void Init()
							 | 
						|
										{
							 | 
						|
											_iniFile = new IniFileHelper(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "LocalStorage.ini");
							 | 
						|
										}
							 | 
						|
								
							 | 
						|
										public static string GetStorage(string name)
							 | 
						|
										{
							 | 
						|
											return _iniFile.IniReadValue(Section, name);
							 | 
						|
										}
							 | 
						|
								
							 | 
						|
										public static void SetStorage(string name, string strVal)
							 | 
						|
										{
							 | 
						|
											_iniFile.WriteString(Section, name, strVal);
							 | 
						|
										}
							 | 
						|
								
							 | 
						|
										public static int GetStorageInt(string name)
							 | 
						|
										{
							 | 
						|
											return FormatCom.ToInt(GetStorage(name));
							 | 
						|
										}
							 | 
						|
								
							 | 
						|
										/// <summary>
							 | 
						|
										/// [扩展]写入Int数值,如果不存在 节-键,则会自动创建
							 | 
						|
										/// </summary>
							 | 
						|
										/// <param name="name">键</param>
							 | 
						|
										/// <param name="intVal">写入值</param>
							 | 
						|
										public static void SetStorage(string name, int intVal)
							 | 
						|
										{
							 | 
						|
											_iniFile.WriteInt(Section, name, intVal);
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								}
							 |