@Nico Zhu (Shanghai Wicresoft Co,.Ltd.)
private async void check()
{
loading_bar.Value = 0;
var tasks = new List<Task>();
for (int days = 1; days < 32; days++)
{
tasks.Add(Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(0.01));
for (int room = 1; room < 321; room++)
{
loading_bar.Value = loading_bar.Value + 0.0493;
string date = "";
if (x > 9) { date = $"{x}.01.2022"; }
if (x < 10) { date = $"0{x}.01.2022"; }
StorageFolder folderApp = await KnownFolders.DocumentsLibrary.GetFolderAsync("My Application");
try { StorageFolder folderDATE = await folderApp.GetFolderAsync(data); }
catch { Windows.Storage.StorageFolder folderDATE = await folderApp.CreateFolderAsync(data, CreationCollisionOption.ReplaceExisting); }
StorageFolder newfolderDATE = await folderApp.GetFolderAsync(data);
try { StorageFile file = await newfolderDATE.GetFileAsync(room + ".dat"); }
catch { Windows.Storage.StorageFile file = await newfolderDATE.CreateFileAsync(room + ".dat", CreationCollisionOption.ReplaceExisting); }
Windows.Storage.StorageFile fileROOM = await newfolderDATE.GetFileAsync(room + ".dat");
string text = await Windows.Storage.FileIO.ReadTextAsync(fileROOM);
if (days == 1)
{
if ((room == 1) && (text == "")) { room4two.Text = room4two.Text + " " + room + ","; }
if ((room == 2) && (text == "")) { room4two.Text = room4two.Text + " " + room + ","; }
etc...blah blah blah.,..
}
}
}));
}
Task t = Task.WhenAll(tasks);
loading_bar.Visibility = Visibility.Collapsed;
}
App is for calculating and showing available rooms from checking all room files from saved data.
Problem: not calculating or not showing anything.