razeedazee
razeedazee
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i kind of understand the error, but i don't get what solution is
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
@mtreit when i look at your example, why does my visual studio shwo this error
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
thanks
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i should be able to make a function here?
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i have a few buttons using same code except for different dirs
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
private async void buttonYaesha_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.InitialDirectory = Directory.GetParent(AppContext.BaseDirectory).Parent.FullName + @"\instances\yaesha";

if (dialog.ShowDialog() == DialogResult.OK)
{
selectedInstances = dialog.SelectedPath;
textBoxInstances.Text = dialog.SelectedPath;
}

if (File.Exists(dialog.SelectedPath + @"\README.md"))
{
await webView2Readme.EnsureCoreWebView2Async(null);
string yolo = Markdown.ToHtml(File.ReadAllText(dialog.SelectedPath + @"\README.md"));
webView2Readme.NavigateToString(yolo);

}

pictureBoxMiniMap.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBoxInfo.SizeMode = PictureBoxSizeMode.StretchImage;

if (File.Exists(dialog.SelectedPath + @"\info\mini-map.png"))
pictureBoxMiniMap.Image = Image.FromFile(dialog.SelectedPath + @"\info\mini-map.png");
else if (File.Exists(dialog.SelectedPath + @"\..\info\mini-map.png"))
pictureBoxMiniMap.Image = Image.FromFile(dialog.SelectedPath + @"\..\info\mini-map.png");
else
pictureBoxMiniMap.Image = null;

if (File.Exists(dialog.SelectedPath + @"\info\info.png"))
pictureBoxInfo.Image = Image.FromFile(dialog.SelectedPath + @"\info\info.png");
else if (File.Exists(dialog.SelectedPath + @"\..\info\info.png"))
pictureBoxInfo.Image = Image.FromFile(dialog.SelectedPath + @"\..\info\info.png");
else
pictureBoxInfo.Image = null;
}
private async void buttonYaesha_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.InitialDirectory = Directory.GetParent(AppContext.BaseDirectory).Parent.FullName + @"\instances\yaesha";

if (dialog.ShowDialog() == DialogResult.OK)
{
selectedInstances = dialog.SelectedPath;
textBoxInstances.Text = dialog.SelectedPath;
}

if (File.Exists(dialog.SelectedPath + @"\README.md"))
{
await webView2Readme.EnsureCoreWebView2Async(null);
string yolo = Markdown.ToHtml(File.ReadAllText(dialog.SelectedPath + @"\README.md"));
webView2Readme.NavigateToString(yolo);

}

pictureBoxMiniMap.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBoxInfo.SizeMode = PictureBoxSizeMode.StretchImage;

if (File.Exists(dialog.SelectedPath + @"\info\mini-map.png"))
pictureBoxMiniMap.Image = Image.FromFile(dialog.SelectedPath + @"\info\mini-map.png");
else if (File.Exists(dialog.SelectedPath + @"\..\info\mini-map.png"))
pictureBoxMiniMap.Image = Image.FromFile(dialog.SelectedPath + @"\..\info\mini-map.png");
else
pictureBoxMiniMap.Image = null;

if (File.Exists(dialog.SelectedPath + @"\info\info.png"))
pictureBoxInfo.Image = Image.FromFile(dialog.SelectedPath + @"\info\info.png");
else if (File.Exists(dialog.SelectedPath + @"\..\info\info.png"))
pictureBoxInfo.Image = Image.FromFile(dialog.SelectedPath + @"\..\info\info.png");
else
pictureBoxInfo.Image = null;
}
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i have some repeated code i would function in bash but not sure how i do it in NET
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i know how to do it in bash scripting.
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
one thing i would like to know is how to make a function i reuse.
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
it won't hurt to try and do it well. right now i'm just fumbling along with googles examples
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
@mtreit thanks for the example. i will try understand it
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
thanks
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
foreach (var value in list_of_files_that_match)
{
listBoxSearch.Items.Add(Path.GetDirectoryName(value));
}
foreach (var value in list_of_files_that_match)
{
listBoxSearch.Items.Add(Path.GetDirectoryName(value));
}
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
this seems to have worked, in regards to function
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
the code optimisation thing is going to go over my head unless you ELI5 with examples.
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i am using windows forms with net 7 via Visual Studio.
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i need to the search the README.md files for a string and ideally list the parent dir.
48 replies
CC#
Created by razeedazee on 8/28/2023 in #help
❔ .NET split string that is in a list
i am a NET noob, i am pasting away till things work with a poor grasp
48 replies