Devastorian
Devastorian
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
Created a service that Copies the images from the Source file to destination file, the destination file being my root folder, works like a charm 😄
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
public class ImageCopyService { public void CopyPngImages(string sourceFolder, string destinationFolder) { // Zkontrolujte, zda zdrojová složka existuje if (!Directory.Exists(sourceFolder)) { Console.WriteLine("Zdrojová složka neexistuje."); return; } // Projděte všechny soubory s příponou ".png" ve zdrojové složce string[] pngFiles = Directory.GetFiles(sourceFolder, "*.png"); foreach (string filePath in pngFiles) { // Získání názvu souboru z cesty string fileName = Path.GetFileName(filePath); Console.WriteLine(fileName); // Vytvoření cesty pro cílovou složku string destinationPath = Path.Combine(destinationFolder, fileName); // Kopírování souboru do cílové složky File.Copy(filePath, destinationPath, true); } } }
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
Sadly those workarounds are pain and are hardly used ever again
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
I will try some things, and post how it went.
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
Ahh, well I could try that, but would it work while the app would be published? Tons of stuff worked while I was debugging, but while I publish I always cross my fingers 😄
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
symlink? Never heard of it.
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
I will try to add an img folder to my root, and on my model or service layer I will just pull the images in, it is a messy thing to do, but it should work.
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
Well, I already had to do some backloops to have that excel work as I intended, also they can edit it while the app is running, so my app has to load it all again every 5 minutes or so 😄
20 replies
CC#
Created by Devastorian on 12/2/2023 in #help
Displaying Images in .NET application, that are out of project folder.
Well, that is a problem, because this is a app that is developed for a company that does not want normal conventional database, so it uses excel as a "database" and the pictures are somewhere inside a directory on windows server. The app is running locally and the data from excel are being loaded normally, maybe I could try to connect the directories somehow, so they mirror each other? Or write a code, that copies all the images from that one directory to my root directory?
20 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
wb.close(); closes the workbook, it has the same logic and function as programming in excel with VBA.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
Here is a tutorial, that worked for me. Only problem is, that office needs to be installed for this to work. Also it is needed to close the workbook after being done with the worksheet or else the book will get locked. https://stardevstudio.com/csharp/how-to-read-excel-files-in-csharp/?mwg_rnd=8606258
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
Thanks, will take a look. I am just trying to do basic stuff, I dont need no styles and fonts etc.. I just want to edit and read values in cells.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
parsing the whole sheet into an multidimensional array might be even worse, but that would mean, that I dont have to be connected to that XLSX constantly, just read it once and work with the data
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
Fat chance, but I will see what can be done.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
I mean, in terms of posibillity, it is probably doable, but that memory issue might still prevail.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
Well, I will try the ClosedXML and see, problem is, that I am talking about thousands of warehouse items, hope it will not be overwhelmed.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
Yeah, that is kinda what is also happening around here, but after a few months there working as the only one who can do some basic sripting and VBA it got better, but not by much.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
I am glad they atleast let me install Visual Studio 😅
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
They care about production, if the project does not yield any added value they dont care, and this just helps maintenance and warehouse management, it is not important for them.
90 replies
CC#
Created by Devastorian on 6/25/2023 in #help
✅ How can I read and edit .XLSX files in C# (WPF)
Tried it a few times, with some other things, like if I can use SAP GUI for creating a more user friendly SAP operations, but nope,
90 replies