fix: path magic

This commit is contained in:
surtur 2020-10-18 14:11:22 +02:00
parent 0fcec4d971
commit bb9ba7db52
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -225,7 +225,7 @@ namespace KRY_0x02
{
/*
* Wrap the creation of the OpenFileDialog instance in a using statement,
* rather than manually calling the Dispose method to ensure proper disposal
* rather than manually calling the Dispose method to ensure proper disposal
*/
using (OpenFileDialog dlg = new OpenFileDialog())
@ -258,7 +258,12 @@ namespace KRY_0x02
private void button5_Click(object sender, EventArgs e)
{
/*/* use-default-pic button */
string filename = @"C:\Users\citizen\source\repos\KRY-0x02\security.png";
string wd = Environment.CurrentDirectory;
Console.WriteLine("* [debug] working directory: " + wd);
string projectDirectory = Directory.GetParent(wd).Parent.FullName;
Console.WriteLine("* [debug] project directory: " + projectDirectory);
string filename = projectDirectory + @"/security.png";
Console.WriteLine("* [debug] filename: " + filename);
pictureBox1.Image = new Bitmap(filename);
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
textBoxsizemode.Text = "auto";