chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// 使用 ConfigService 的示例
|
||||
|
||||
using System;
|
||||
using 報到系統客戶端.Services;
|
||||
|
||||
// 1. 讀取 API 基礎 URL
|
||||
string apiUrl = ConfigService.Instance.GetApiBaseUrl();
|
||||
Console.WriteLine($"目前 API URL: {apiUrl}");
|
||||
|
||||
// 2. 設定新的 API 基礎 URL
|
||||
bool success = ConfigService.Instance.SetApiBaseUrl("http://new-server:8080");
|
||||
if (success)
|
||||
{
|
||||
Console.WriteLine("API URL 已更新");
|
||||
// 更新 ApiService 的 BaseUrl
|
||||
ApiService.Instance.SetBaseUrl("http://new-server:8080");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("API URL 更新失敗");
|
||||
}
|
||||
|
||||
// 3. 取得設定檔路徑
|
||||
string configPath = ConfigService.Instance.GetConfigFilePath();
|
||||
Console.WriteLine($"設定檔路徑: {configPath}");
|
||||
Reference in New Issue
Block a user