Jobini클래스 일부 업데이트
ReadDictionary메서드를 대채할 GetiniData메서드 추가 에러 핸들링을 가진 새로운 메서드임 ReadDictionary는 이제 사용되지 않는 메서드임 ClearLocalDictionaryData라는 새로운 메서드 추가 로컬 스토리지에 저장된 데이터에 들어있는 값을 삭제할 때 사용함 즉 값의 삭제 변경사항에 대하여 메모리에만 반영이 아닌 로컬 데이터에도 영구적인 반영이 필요할때 사용 위의 클래스 변경사항에 맞춰 메인 프로그램 코드도 일부의 수정이 되었음
This commit is contained in:
@@ -148,8 +148,44 @@ public class Jobini
|
|||||||
iniData.Clear();
|
iniData.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<string,string> ReadDictionary()
|
[Obsolete("use GetiniData instead.")]
|
||||||
|
public Dictionary<string, string> ReadDictionary()
|
||||||
{
|
{
|
||||||
return this.iniData;
|
return this.iniData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 딕셔너리 데이터가 저장되있는 파일의 내용을 싹 지웁니다. 결과에 따라 bool형 반환이 존재합니다.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true = 정상적으로 작업이 수행됨, false = 어떠한 오류로 작업에 실패함</returns>
|
||||||
|
public bool ClearLocalDictionaryData()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(File.Exists(this.filePath))
|
||||||
|
{
|
||||||
|
File.WriteAllText(this.filePath, "");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dictionary<string, string>? GetiniData()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return iniData;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@ Jobini settingini = new(filePath);
|
|||||||
Jobini scoreDBini = new(scoreDbPath);
|
Jobini scoreDBini = new(scoreDbPath);
|
||||||
|
|
||||||
//Dictionary<string, string> settingValues = [];
|
//Dictionary<string, string> settingValues = [];
|
||||||
Dictionary<string, string> scoreDB = [];
|
//Dictionary<string, string> scoreDB = [];
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
@@ -85,6 +85,7 @@ resetTimer.Elapsed += (sender, e) =>
|
|||||||
|
|
||||||
// Clear the scoreDB
|
// Clear the scoreDB
|
||||||
scoreDBini.Clear();
|
scoreDBini.Clear();
|
||||||
|
//scoreDBini.ClearLocalDictionaryData();
|
||||||
weekArrow.Clear();
|
weekArrow.Clear();
|
||||||
Random random = new();
|
Random random = new();
|
||||||
for (int i = 0; i < random.NextInt64(int.Parse(settingini.NotNullableiniRead("minArrowNum","10")), int.Parse(settingini.NotNullableiniRead("maxArrowNum","30"))/*10,30*/); i++)
|
for (int i = 0; i < random.NextInt64(int.Parse(settingini.NotNullableiniRead("minArrowNum","10")), int.Parse(settingini.NotNullableiniRead("maxArrowNum","30"))/*10,30*/); i++)
|
||||||
@@ -104,9 +105,11 @@ resetTimer.Elapsed += (sender, e) =>
|
|||||||
//}//<2F>ڱ<EFBFBD> <20>ڽ<EFBFBD><DABD><EFBFBD> <20>а<EFBFBD><D0B0>ִٰ<D6B4> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><EFBFBD><EEB6BB> <20>Ƶ鿩<C6B5><E9BFA9><EFBFBD><EFBFBD>? => resetTimer<65><72> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>尡 <20>ƴ<EFBFBD> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>忡<EFBFBD><E5BFA1> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵٴ<D1B4> ī<><C4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> => jobiniŬ<69><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD> <20>ϳ<EFBFBD> <20><><EFBFBD>Ծ<EFBFBD><D4BE>ٰ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD>? <20>Ƹ<EFBFBD> <20>ذ<EFBFBD><D8B0><EFBFBD>
|
//}//<2F>ڱ<EFBFBD> <20>ڽ<EFBFBD><DABD><EFBFBD> <20>а<EFBFBD><D0B0>ִٰ<D6B4> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><EFBFBD><EEB6BB> <20>Ƶ鿩<C6B5><E9BFA9><EFBFBD><EFBFBD>? => resetTimer<65><72> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>尡 <20>ƴ<EFBFBD> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>忡<EFBFBD><E5BFA1> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵٴ<D1B4> ī<><C4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> => jobiniŬ<69><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DEBC><EFBFBD> <20>ϳ<EFBFBD> <20><><EFBFBD>Ծ<EFBFBD><D4BE>ٰ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD>? <20>Ƹ<EFBFBD> <20>ذ<EFBFBD><D8B0><EFBFBD>
|
||||||
resetTimer.Start();
|
resetTimer.Start();
|
||||||
//<2F><><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
//<2F><><EFBFBD>ϵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
app.MapGet("/", () => /*scoreDB);*/scoreDB = scoreDBini.ReadDictionary());//scoreDBini.ReadDictionary);
|
app.MapGet("/", () => scoreDBini.GetiniData());//scoreDBini.ReadDictionary);
|
||||||
|
|
||||||
app.MapGet("WeekArrow", ()=> weekArrow);
|
app.MapGet("WeekArrow", () => weekArrow);
|
||||||
|
|
||||||
|
//app.MapGet("cleartest", () => scoreDBini.ClearLocalDictionaryData());
|
||||||
|
|
||||||
//app.UseHttpsRedirection();
|
//app.UseHttpsRedirection();
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|||||||
Reference in New Issue
Block a user