mirror of
https://github.com/ApfelTeeSaft/STW-Reborn-Launcher.git
synced 2026-08-26 19:33:40 +00:00
initial commit
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.33530.505
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSTW", "WpfApp6\PSTW.csproj", "{355A0DBF-B506-4AFC-9C0E-2884A2169337}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{355A0DBF-B506-4AFC-9C0E-2884A2169337}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{355A0DBF-B506-4AFC-9C0E-2884A2169337}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{355A0DBF-B506-4AFC-9C0E-2884A2169337}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{355A0DBF-B506-4AFC-9C0E-2884A2169337}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {13A9430D-AC9A-43D0-92CB-D4263C2DCE35}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
@@ -0,0 +1,17 @@
|
||||
<Application x:Class="WpfApp6.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:WpfApp6"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ui:ThemeResources />
|
||||
<ui:XamlControlsResources />
|
||||
<!-- Other merged dictionaries here -->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<!-- Other app resources here -->
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace WpfApp6
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
@@ -0,0 +1,35 @@
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WpfApp6"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfApp6.MainWindow"
|
||||
mc:Ignorable="d"
|
||||
Title="STW - Reborn" Height="613" Width="908"
|
||||
ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="315*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0*"/>
|
||||
<ColumnDefinition Width="481*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:NavigationView x:Name="NavView" Loaded="NavView_Loaded" SelectionChanged="NavView_SelectionChanged" PaneDisplayMode="Left" IsBackButtonVisible="Collapsed" IsPaneToggleButtonVisible="False" IsPaneOpen="True" HorizontalAlignment="Left" Width="800" Grid.ColumnSpan="4">
|
||||
<ui:NavigationView.MenuItems>
|
||||
<ui:NavigationViewItem Icon="Play" Content="Home" Tag="Home"/>
|
||||
<ui:NavigationViewItem Icon="Download" Content="Download" Tag="Downloader"/>
|
||||
<!-- Add the Announcements item -->
|
||||
<ui:NavigationViewItem Icon="Important" Content="Announcements" Tag="Announcements"/>
|
||||
</ui:NavigationView.MenuItems>
|
||||
</ui:NavigationView>
|
||||
<ui:Frame x:Name="ContentFrame" Margin="330,10,10,10" Grid.ColumnSpan="4">
|
||||
<ui:Frame.ContentTransitions >
|
||||
<ui:TransitionCollection>
|
||||
<ui:NavigationThemeTransition />
|
||||
</ui:TransitionCollection>
|
||||
</ui:Frame.ContentTransitions>
|
||||
</ui:Frame>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,165 @@
|
||||
using ModernWpf.Controls;
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using WpfApp6.Pages;
|
||||
using ModernWpf.Media.Animation;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.IO;
|
||||
|
||||
namespace WpfApp6
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
Home home = new Home();
|
||||
Settings settings = new Settings();
|
||||
Downloader download = new Downloader();
|
||||
Loading loading = new Loading();
|
||||
AnnouncementsPage announcementsPage = new AnnouncementsPage(); // Add AnnouncementsPage instance
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (!CheckInternetConnection())
|
||||
{
|
||||
MessageBox.Show("You need to be connected to the internet.");
|
||||
Close();
|
||||
}
|
||||
|
||||
ContentFrame.Navigate(loading);
|
||||
|
||||
// Check server status and Version
|
||||
CheckServerStatusAndVersion();
|
||||
}
|
||||
|
||||
private void NavView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ContentFrame.Navigate(home);
|
||||
}
|
||||
|
||||
private bool CheckInternetConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
Ping ping = new Ping();
|
||||
PingReply reply = ping.Send("www.google.com", 3000);
|
||||
return reply != null && reply.Status == IPStatus.Success;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void NavView_SelectionChanged(ModernWpf.Controls.NavigationView sender, ModernWpf.Controls.NavigationViewSelectionChangedEventArgs args)
|
||||
{
|
||||
if (args.IsSettingsSelected)
|
||||
{
|
||||
ContentFrame.Navigate(settings);
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationViewItem item = args.SelectedItem as NavigationViewItem;
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
if (item.Tag != null)
|
||||
{
|
||||
if (item.Tag.ToString() == "Home")
|
||||
{
|
||||
ContentFrame.Navigate(home);
|
||||
}
|
||||
else if (item.Tag.ToString() == "Downloader")
|
||||
{
|
||||
ContentFrame.Navigate(new Downloader());
|
||||
}
|
||||
else if (item.Tag.ToString() == "Announcements")
|
||||
{
|
||||
ContentFrame.Navigate(announcementsPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void CheckServerStatusAndVersion()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Check server status
|
||||
await CheckUrlEndpoint("http://127.0.0.1:5000/api/access_status"); //replace with your actual server ip
|
||||
|
||||
// Check version
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
HttpResponseMessage response = await client.GetAsync("http://127.0.0.1:5000/api/version"); //replace with your actual server ip
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string jsonString = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// Parse the JSON string
|
||||
var json = System.Text.Json.JsonDocument.Parse(jsonString);
|
||||
var version = json.RootElement.GetProperty("version").GetString();
|
||||
|
||||
if (version.Equals("0.3", StringComparison.InvariantCulture))
|
||||
{
|
||||
// Continue with the rest of the code
|
||||
ContentFrame.Navigate(home);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"Please Update The Launcher to {version}");
|
||||
Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"Server returned non-success status code: {response.StatusCode}");
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"An error occurred: {ex.Message}");
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CheckUrlEndpoint(string url)
|
||||
{
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
HttpResponseMessage response = await client.GetAsync(url);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
if (content.Equals("Denied", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MessageBox.Show("Server Maintenance", "Access Denied");
|
||||
Close();
|
||||
}
|
||||
// No need to check for "Allowed" explicitly, as it will continue with the execution
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"Failed to check the URL. Status code: {response.StatusCode}");
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||
{
|
||||
throw new Exception("Failed to load Page."); // Never TBH
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ApplicationIcon>82b12ac249fbb223299e6a234b87b948.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Pages\82b12ac249fbb223299e6a234b87b948.png" />
|
||||
<None Remove="Pages\CloudArrow.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="82b12ac249fbb223299e6a234b87b948.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ini-parser" Version="2.5.2" />
|
||||
<PackageReference Include="ModernWpfUI" Version="0.9.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="SevenZip" Version="19.0.0" />
|
||||
<PackageReference Include="WindowsAPICodePack.Shell.CommonFileDialogs" Version="1.1.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Pages\82b12ac249fbb223299e6a234b87b948.png" />
|
||||
<Resource Include="Pages\CloudArrow.png" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_LastSelectedProfileId>C:\Users\vloge\source\repos\WpfApp6\WpfApp6\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Update="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Pages\Home.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Pages\Downloader.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Pages\Loading.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Pages\AnnouncementsPage.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="MainWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Pages\Home.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Pages\Downloader.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Pages\Loading.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Pages\AnnouncementsPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@@ -0,0 +1,14 @@
|
||||
<Page x:Class="WpfApp6.Pages.AnnouncementsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Background="Transparent">
|
||||
|
||||
<Grid>
|
||||
<StackPanel x:Name="AnnouncementsStackPanel" Margin="10">
|
||||
<!-- Announcements will be added here dynamically -->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,125 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
public partial class AnnouncementsPage : Page
|
||||
{
|
||||
public AnnouncementsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
LoadDataFromApi();
|
||||
}
|
||||
|
||||
private async void LoadDataFromApi()
|
||||
{
|
||||
try
|
||||
{
|
||||
string apiUrl = "http://127.0.0.1:5000/api/announcements"; //replace with actual server url
|
||||
using (HttpClient client = new HttpClient())
|
||||
{
|
||||
string jsonResult = await client.GetStringAsync(apiUrl);
|
||||
|
||||
JObject data = JObject.Parse(jsonResult);
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
// Assuming "announcements" is the property containing the array of announcements
|
||||
JArray announcementsArray = (JArray)data["announcements"];
|
||||
|
||||
if (announcementsArray != null)
|
||||
{
|
||||
// Deserialize the JSON array into a list of Announcement objects
|
||||
List<Announcement> announcements = announcementsArray.Select(item => new Announcement
|
||||
{
|
||||
Author = item["author"].ToString(),
|
||||
Avatar = item["avatar"].ToString(),
|
||||
Message = item["message"].ToString(),
|
||||
DateTime = DateTime.Parse(item["datetime"].ToString()) // Assuming the datetime field in JSON
|
||||
}).ToList();
|
||||
|
||||
// Sort the announcements by DateTime in descending order (newest first)
|
||||
announcements = announcements.OrderByDescending(a => a.DateTime).ToList();
|
||||
|
||||
// Display the sorted announcements
|
||||
foreach (var announcement in announcements)
|
||||
{
|
||||
AddAnnouncementToUI(announcement.Author, announcement.Avatar, announcement.Message, announcement.DateTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error: {ex.Message}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddAnnouncementToUI(string author, string avatarUrl, string message, DateTime dateTime)
|
||||
{
|
||||
|
||||
// Assume dateTime is in UTC
|
||||
var utcTime = DateTime.SpecifyKind(dateTime, DateTimeKind.Utc);
|
||||
|
||||
// Convert UTC time to local time
|
||||
var localTimeZone = TimeZoneInfo.Local;
|
||||
var localTimeConverted = TimeZoneInfo.ConvertTime(utcTime, localTimeZone);
|
||||
|
||||
StackPanel announcementPanel = new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
Margin = new Thickness(10)
|
||||
};
|
||||
|
||||
Image avatarImage = new Image
|
||||
{
|
||||
Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(avatarUrl)),
|
||||
Width = 50,
|
||||
Height = 50,
|
||||
Margin = new Thickness(0, 0, 10, 0)
|
||||
};
|
||||
|
||||
TextBlock authorTextBlock = new TextBlock
|
||||
{
|
||||
Text = $"{author}",
|
||||
FontWeight = FontWeights.Bold,
|
||||
Foreground = new System.Windows.Media.SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#ff00e2"))
|
||||
};
|
||||
|
||||
TextBlock messageTextBlock = new TextBlock
|
||||
{
|
||||
Text = message,
|
||||
Margin = new Thickness(10, 0, 0, 0)
|
||||
};
|
||||
|
||||
TextBlock dateTextBlock = new TextBlock
|
||||
{
|
||||
Text = $" ({localTimeConverted:yyyy-MM-dd HH:mm})",
|
||||
Foreground = new System.Windows.Media.SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#87CEEB")) // Light blue color
|
||||
};
|
||||
|
||||
announcementPanel.Children.Add(avatarImage);
|
||||
announcementPanel.Children.Add(authorTextBlock);
|
||||
announcementPanel.Children.Add(messageTextBlock);
|
||||
announcementPanel.Children.Add(dateTextBlock);
|
||||
|
||||
AnnouncementsStackPanel.Children.Add(announcementPanel);
|
||||
}
|
||||
}
|
||||
|
||||
// Define a class to represent an Announcement
|
||||
public class Announcement
|
||||
{
|
||||
public string Author { get; set; }
|
||||
public string Avatar { get; set; }
|
||||
public string Message { get; set; }
|
||||
public DateTime DateTime { get; set; }
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 87 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,16 @@
|
||||
<UserControl x:Class="WpfApp6.Pages.Downloader"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp6.Pages"
|
||||
mc:Ignorable="d" Width="386" Height="464">
|
||||
<Grid>
|
||||
|
||||
|
||||
<Image HorizontalAlignment="Center" Height="142" Margin="0,45,0,0" VerticalAlignment="Top" Width="146" Source="/Pages/CloudArrow.png" RenderTransformOrigin="1.268,0.599" Stretch="Fill"/>
|
||||
<Button Content="Download Build" Margin="0,232,0,0" VerticalAlignment="Top" Width="116" Height="45" HorizontalAlignment="Center" Click="Button1_Click"/>
|
||||
<ProgressBar x:Name="DownloadProgressBar" Margin="10,327,10,0" VerticalAlignment="Top" Height="20"/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using SevenZip;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Downloader.xaml
|
||||
/// </summary>
|
||||
public partial class Downloader : System.Windows.Controls.UserControl
|
||||
{
|
||||
public Downloader()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button1_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Ask where it should download to
|
||||
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
|
||||
DialogResult result = folderBrowserDialog.ShowDialog();
|
||||
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
string downloadPath = folderBrowserDialog.SelectedPath;
|
||||
|
||||
// Download a file from a website
|
||||
WebClient webClient = new WebClient();
|
||||
// Hook up the event handler for download progress
|
||||
webClient.DownloadProgressChanged += WebClient_DownloadProgressChanged;
|
||||
// Start the Download
|
||||
webClient.DownloadFile("https://example.com/samplefile.zip", System.IO.Path.Combine(downloadPath, "samplefile.zip")); //replace with link to download
|
||||
|
||||
// For simplicity, I'll just show a message box
|
||||
System.Windows.MessageBox.Show("File downloaded and extracted successfully!");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Windows.MessageBox.Show($"Error: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void WebClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
||||
{
|
||||
// Update the progress bar value based on the download progress
|
||||
DownloadProgressBar.Value = e.ProgressPercentage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<UserControl x:Class="WpfApp6.Pages.Home"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp6.Pages"
|
||||
mc:Ignorable="d" Width="386" Height="364">
|
||||
<Grid>
|
||||
|
||||
|
||||
<Image HorizontalAlignment="Left" Height="142" Margin="122,40,0,0" VerticalAlignment="Top" Width="146" Source="/Pages/82b12ac249fbb223299e6a234b87b948.png" RenderTransformOrigin="1.268,0.599"/>
|
||||
<Button Content="Launch" Margin="0,284,0,0" VerticalAlignment="Top" Width="116" Height="45" HorizontalAlignment="Center" Click="Button_Click"/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using WpfApp6.Services;
|
||||
using WpfApp6.Services.Launch;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Home.xaml
|
||||
/// </summary>
|
||||
public partial class Home
|
||||
{
|
||||
public Home()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string path69 = UpdateINI.ReadValue("Auth", "Path");
|
||||
if (path69 != "NONE")
|
||||
{
|
||||
string exeFilePath = System.IO.Path.Join(path69, "FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe");
|
||||
|
||||
// Check if the file exists and its version matches
|
||||
if (File.Exists(exeFilePath) && IsFileVersionMatch(exeFilePath, new Version("4.21.0.0")))
|
||||
{
|
||||
if (UpdateINI.ReadValue("Auth", "Email") == "NONE" || UpdateINI.ReadValue("Auth", "Password") == "NONE")
|
||||
{
|
||||
MessageBox.Show("Please Add Your STW - Reborn Info In Settings");
|
||||
return;
|
||||
}
|
||||
|
||||
WebClient OMG = new WebClient();
|
||||
OMG.DownloadFile("https://cdn.discordapp.com/attachments/1173026686359584808/1173059010568650802/STWCurl.dll?ex=65629356&is=65501e56&hm=3089fbfad67a76a163a5d207ff239628fb62917c66536782962f73901dd7025c&", Path.Combine(path69, "Engine\\Binaries\\ThirdParty\\NVIDIA\\NVaftermath\\Win64", "GFSDK_Aftermath_Lib.x64.dll")); //replace with your curl
|
||||
|
||||
PSBasics.Start(path69, "-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -noeac -fromfl=be -fltoken=h1cdhchd10150221h130eB56 -skippatchcheck", UpdateINI.ReadValue("Auth", "Email"), UpdateINI.ReadValue("Auth", "Password"));
|
||||
|
||||
FakeAC.Start(path69, "FortniteClient-Win64-Shipping_BE.exe", $"-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -noeac -fromfl=be -fltoken=h1cdhchd10150221h130eB56 -skippatchcheck", "r");
|
||||
FakeAC.Start(path69, "FortniteLauncher.exe", $"-epicapp=Fortnite -epicenv=Prod -epiclocale=en-us -epicportal -noeac -fromfl=be -fltoken=h1cdhchd10150221h130eB56 -skippatchcheck", "dsf");
|
||||
|
||||
PSBasics._FortniteProcess.WaitForExit();
|
||||
|
||||
try
|
||||
{
|
||||
FakeAC._FNLauncherProcess.Close();
|
||||
FakeAC._FNAntiCheatProcess.Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("There has been an error closing");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Error: Either the file does not exist or the version is incorrect!\nVersion Required: 5.41");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("UNKNOWN ERROR");
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsFileVersionMatch(string filePath, Version expectedVersion)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(filePath);
|
||||
|
||||
int fileMajorPart = fileVersionInfo.FileMajorPart;
|
||||
int fileMinorPart = fileVersionInfo.FileMinorPart;
|
||||
int fileBuildPart = fileVersionInfo.FileBuildPart;
|
||||
int filePrivatePart = fileVersionInfo.FilePrivatePart;
|
||||
|
||||
return fileMajorPart == expectedVersion.Major &&
|
||||
fileMinorPart == expectedVersion.Minor &&
|
||||
fileBuildPart == expectedVersion.Build &&
|
||||
filePrivatePart == expectedVersion.Revision;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<UserControl x:Class="WpfApp6.Pages.Loading"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid Background="Black">
|
||||
<ProgressBar Name="LoadingProgressBar" HorizontalAlignment="Center" VerticalAlignment="Center" Width="400" Height="20" IsIndeterminate="True"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Page1.xaml
|
||||
/// </summary>
|
||||
public partial class Loading
|
||||
{
|
||||
public Loading()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<UserControl
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp6.Pages"
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfApp6.Pages.Settings"
|
||||
mc:Ignorable="d" d:DesignWidth="386" Height="366">
|
||||
<Grid>
|
||||
<TextBox x:Name="EmailBox" Margin="0,38,0,0" TextWrapping="Wrap" Text="" PreviewTextInput="TextBox_PreviewTextInput" VerticalAlignment="Top" Width="352" TextChanged="TextBox_TextChanged"/>
|
||||
<PasswordBox x:Name="PasswordBox" HorizontalAlignment="Center" Margin="0,104,0,0" VerticalAlignment="Top" Width="352"/>
|
||||
<Grid Margin="0,152,0,152" HorizontalAlignment="Center" Width="352">
|
||||
<TextBox x:Name="PathBox" Margin="0,0,35,0" TextWrapping="Wrap" Text="" VerticalAlignment="Center" TextChanged="PathBox_TextChanged"/>
|
||||
<Button Content="..." Margin="322,0,0,0" Width="30" RenderTransformOrigin="-1.3,-0.387" Click="Button_Click"/>
|
||||
</Grid>
|
||||
<Button Content="Save" Margin="280,318,0,0" VerticalAlignment="Top" Width="89" Height="32" Click="Button_Click_1"/>
|
||||
<Label Content="Email:" HorizontalAlignment="Left" Margin="10,17,0,0" VerticalAlignment="Top"/>
|
||||
<Label Content="Password:" HorizontalAlignment="Left" Margin="10,83,0,0" VerticalAlignment="Top"/>
|
||||
<Label Content="Path:" HorizontalAlignment="Left" Margin="10,148,0,0" VerticalAlignment="Top"/>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using WindowsAPICodePack.Dialogs;
|
||||
using WpfApp6.Services;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
|
||||
|
||||
namespace WpfApp6.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Settings.xaml
|
||||
/// </summary>
|
||||
public partial class Settings : UserControl
|
||||
{
|
||||
public Settings()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
//Regex r = new Regex(@"^[a-zA-Z@]+$");
|
||||
//if (!r.IsMatch(e.Text))
|
||||
//e.Handled = true;
|
||||
}
|
||||
|
||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CommonOpenFileDialog commonOpenFileDialog = new CommonOpenFileDialog();
|
||||
commonOpenFileDialog.IsFolderPicker = true;
|
||||
commonOpenFileDialog.Title = "Select A Fortnite Build";
|
||||
commonOpenFileDialog.Multiselect = false;
|
||||
CommonFileDialogResult commonFileDialogResult = commonOpenFileDialog.ShowDialog();
|
||||
|
||||
|
||||
bool flag = commonFileDialogResult == CommonFileDialogResult.Ok;
|
||||
if (flag)
|
||||
{
|
||||
if (File.Exists(System.IO.Path.Join(commonOpenFileDialog.FileName, "FortniteGame\\Binaries\\Win64\\FortniteClient-Win64-Shipping.exe")))
|
||||
{
|
||||
this.PathBox.Text = commonOpenFileDialog.FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Please make sure that your the folder contains FortniteGame and Engine In");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdateINI.WriteToConfig("Auth","Email", EmailBox.Text);
|
||||
UpdateINI.WriteToConfig("Auth", "Password", PasswordBox.Password);
|
||||
UpdateINI.WriteToConfig("Auth", "Path", PathBox.Text);
|
||||
}
|
||||
|
||||
private void PathBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
UpdateINI.WriteToConfig("Auth", "Path", PathBox.Text); // Updates Live OMG!
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Telerik.Windows.Controls.RadNotifyIcon, Telerik.Windows.Controls.Navigation, Version=2022.3.1109.310, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>bin\Release\net6.0-windows\publish\win-x64\</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>True|2023-07-04T20:49:13.1871919Z;True|2023-07-04T18:07:33.0033043+01:00;True|2023-07-03T19:28:33.2007094+01:00;True|2023-07-03T19:26:52.9596367+01:00;True|2023-07-03T14:33:19.6511979+01:00;True|2023-07-03T13:18:02.6330185+01:00;True|2023-07-03T12:59:35.6618992+01:00;True|2023-07-02T14:31:30.7023566+01:00;False|2023-07-02T14:28:00.9894053+01:00;True|2023-07-02T14:26:09.9688668+01:00;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace WpfApp6.Services.Launch
|
||||
{
|
||||
// Goofy Code Need To Improve On V2
|
||||
public class FakeAC
|
||||
{
|
||||
public static Process _FNLauncherProcess;
|
||||
public static Process _FNAntiCheatProcess;
|
||||
|
||||
public static void Start(string Path69, string FileName, string args = "", string t = "r")
|
||||
{
|
||||
try {
|
||||
if (File.Exists(Path.Combine(Path69, "FortniteGame\\Binaries\\Win64\\", FileName)))
|
||||
{
|
||||
ProcessStartInfo ProcessIG = new ProcessStartInfo()
|
||||
{
|
||||
FileName = Path.Combine(Path69, "FortniteGame\\Binaries\\Win64\\", FileName),
|
||||
Arguments = args,
|
||||
CreateNoWindow = true,
|
||||
};
|
||||
|
||||
if(t == "r")
|
||||
{
|
||||
_FNAntiCheatProcess = Process.Start(ProcessIG);
|
||||
if (_FNAntiCheatProcess.Id == 0)
|
||||
{
|
||||
MessageBox.Show("FAILED STARTING!?!?!");
|
||||
}
|
||||
_FNAntiCheatProcess.Freeze();
|
||||
}else
|
||||
{
|
||||
_FNLauncherProcess = Process.Start(ProcessIG);
|
||||
if (_FNLauncherProcess.Id == 0)
|
||||
{
|
||||
MessageBox.Show("FAILED STARTING!?!?!");
|
||||
}
|
||||
_FNLauncherProcess.Freeze();
|
||||
}
|
||||
|
||||
}
|
||||
}catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("THERE BEEN A ERROR");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WpfApp6.Services.Launch
|
||||
{
|
||||
public static class Freeze69
|
||||
{
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern IntPtr OpenThread(int dwDesiredAccess, bool bInheritHandle, uint dwThreadId);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern uint SuspendThread(IntPtr hThread);
|
||||
|
||||
public static void Freeze(this Process process)
|
||||
{
|
||||
|
||||
foreach (object obj in process.Threads)
|
||||
{
|
||||
ProcessThread thread = (ProcessThread)obj;
|
||||
var Thread = OpenThread(2, false, (uint)thread.Id);
|
||||
if (Thread == IntPtr.Zero)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SuspendThread(Thread);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace WpfApp6.Services.Launch
|
||||
{
|
||||
public static class PSBasics
|
||||
{
|
||||
public static Process _FortniteProcess;
|
||||
public static void Start(string PATH, string args, string Email, string Password)
|
||||
{
|
||||
if(Email == null || Password == null)
|
||||
{
|
||||
MessageBox.Show("Sorry Make Sure You Put Your PSTW Logins");
|
||||
return;
|
||||
}
|
||||
if (File.Exists(Path.Combine(PATH, "FortniteGame\\Binaries\\Win64\\", "FortniteClient-Win64-Shipping.exe")))
|
||||
{
|
||||
PSBasics._FortniteProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
Arguments = $"-AUTH_LOGIN={Email} -AUTH_PASSWORD={Password} -AUTH_TYPE=epic " + args,
|
||||
FileName = Path.Combine(PATH, "FortniteGame\\Binaries\\Win64\\", "FortniteClient-Win64-Shipping.exe")
|
||||
},
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
PSBasics._FortniteProcess.Exited += new EventHandler(PSBasics.OnFortniteExit);
|
||||
PSBasics._FortniteProcess.Start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void OnFortniteExit(object sender, EventArgs e)
|
||||
{
|
||||
Process fortniteProcess = PSBasics._FortniteProcess;
|
||||
if (fortniteProcess != null && fortniteProcess.HasExited)
|
||||
{
|
||||
PSBasics._FortniteProcess = (Process)null;
|
||||
}
|
||||
FakeAC._FNLauncherProcess?.Kill();
|
||||
FakeAC._FNAntiCheatProcess?.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WpfApp6.Services
|
||||
{
|
||||
// Code Might Be Bad Never Really Touched INI Files
|
||||
public static class UpdateINI
|
||||
{
|
||||
public static void WriteToConfig(string SectionName, string PathKey, string NewValue)
|
||||
{
|
||||
string BaseFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
string DataFolder = Path.Combine(BaseFolder, "PSTW");
|
||||
Directory.CreateDirectory(DataFolder);
|
||||
string FilePath = Path.Combine(DataFolder, "Settings.ini");
|
||||
|
||||
|
||||
FileIniDataParser parser = new FileIniDataParser(); // nEW!
|
||||
|
||||
IniData iniData;
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
iniData = parser.ReadFile(FilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
iniData = new IniData();
|
||||
}
|
||||
|
||||
// This Updates The Current Values - IG!?!?!?!?!?!??!?!//
|
||||
|
||||
//IniData iniData = parser.ReadFile(FilePath);
|
||||
iniData[SectionName][PathKey] = NewValue;
|
||||
parser.WriteFile(FilePath, iniData, null);
|
||||
}
|
||||
|
||||
public static string ReadValue(string SectionName, string PathKey) // NO T writing !
|
||||
{
|
||||
string BaseFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
string DataFolder = Path.Combine(BaseFolder, "PSTW");
|
||||
string FilePath = Path.Combine(DataFolder, "Settings.ini");
|
||||
|
||||
FileIniDataParser parser = new FileIniDataParser();
|
||||
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
IniData iniData = parser.ReadFile(FilePath);
|
||||
|
||||
return iniData[SectionName][PathKey];
|
||||
}
|
||||
else
|
||||
{
|
||||
return "NONE";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user