Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Miscellaneous Changes
Browse files Browse the repository at this point in the history
1. Remove unused directives.
2. hasPermission method was misspelt, fixed.
3. Write UnauthorizedAccessException to console, probably won't be
useful but #fixallthewarnings
  • Loading branch information
PhantomGamers committed Jul 29, 2018
1 parent be4ff3a commit 37fe50c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Metro Skin Installer/Metro Skin Installer/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Net;
Expand All @@ -20,20 +16,21 @@ public MainForm()
{
InitializeComponent();
CheckForIllegalCrossThreadCalls = false;
if (!hasPerimssion(FindSteamSkinDir()))
if (!hasPermission(FindSteamSkinDir()))
{
Environment.Exit(0);
}
}

public static bool hasPerimssion(string dir)
public static bool hasPermission(string dir)
{
try
{
File.CreateText(dir + "\\chkPerm").Close();
}
catch (System.UnauthorizedAccessException e)
catch (UnauthorizedAccessException e)
{
Console.WriteLine("{0} Exception caught.", e);
MessageBox.Show("Access to " + dir + " is denied. Please open the app with admin rights.",
System.Reflection.Assembly.GetCallingAssembly().GetName().Name,
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
Expand Down

0 comments on commit 37fe50c

Please sign in to comment.