❔ what template do i use

what template hsould i use i think winforms right? i just want to be able to open apps like notepad and images inside of my own app, like its embedded basically. like i want to launch something else but i need to be able to control it like its my own app
38 Replies
Thinker
Thinker2y ago
If you just need to open other apps from your app then you can use a regular console application.
Itskillerluc
ItskillerlucOP2y ago
oh and i do need to be able to build it to a one file thing
Thinker
Thinker2y ago
WinForms is generally only for legacy Windows-only GUI apps
Thinker
Thinker2y ago
That's the current application
Itskillerluc
ItskillerlucOP2y ago
what
Thinker
Thinker2y ago
In WinForms, that event fires when the user tries to close the current application.
Itskillerluc
ItskillerlucOP2y ago
yes? so when you close your app
Thinker
Thinker2y ago
yes What do you actually need? What are you trying to make?
Itskillerluc
ItskillerlucOP2y ago
yes i launch something like notepad and i want to do somthing when someone closes it
Thinker
Thinker2y ago
So you want to launch Notepad from inside your app, then do something when the user closes Notepad?
Itskillerluc
ItskillerlucOP2y ago
well my app just launches notepad directly my app doesnt have its own ui but basically yes
Thinker
Thinker2y ago
right
Itskillerluc
ItskillerlucOP2y ago
but maybe something in the console ye
Thinker
Thinker2y ago
yeah I'm pretty sure you don't need WinForms for that
Itskillerluc
ItskillerlucOP2y ago
oh just the console?
Thinker
Thinker2y ago
yeah that's fine
Itskillerluc
ItskillerlucOP2y ago
okie
Thinker
Thinker2y ago
I'm unsure of how to detect when a specific app closes, though.
Itskillerluc
ItskillerlucOP2y ago
and what is the o
Itskillerluc
ItskillerlucOP2y ago
is it just to do the name its not in the --help for dotnet
Thinker
Thinker2y ago
The -o <directory> specifies in what directory the app should be created
Itskillerluc
ItskillerlucOP2y ago
oh
Thinker
Thinker2y ago
Alternatively you can just do dotnet new console -n "MyAppName" and it'll create a new directory with that name and place the app inside that
Itskillerluc
ItskillerlucOP2y ago
i arleady created a folder tho can i just use that
Thinker
Thinker2y ago
Yeah you can run dotnet new console -n "MyAppName" -o .
Itskillerluc
ItskillerlucOP2y ago
oh ye sorry for all teh questions but what is a solution
Thinker
Thinker2y ago
So in C#, there's a thing called a project. A project is something like a console application, a WinForms application, a class library, etc., it's a collection of code which is grouped together to either be run or just exist by itself. When you use dotnet new, it creates a new project, a console application. A solution is just a collection of these projects, because sometimes you'll need to have multiple projects for different reasons. A solution is only really useful with an IDE like Visual Studio, though.
Itskillerluc
ItskillerlucOP2y ago
do i need one?
Thinker
Thinker2y ago
So you can think of it like this A solution contains multiple projects > a project contains multiple files > a file contains classes (code)
Itskillerluc
ItskillerlucOP2y ago
i only need a single project
Thinker
Thinker2y ago
Not if you're using VSCode (which I assume you are)
Itskillerluc
ItskillerlucOP2y ago
i use fleet
Thinker
Thinker2y ago
oh fancy
Itskillerluc
ItskillerlucOP2y ago
yep wanted to test it out on jetbrains website it says to create a solution
Thinker
Thinker2y ago
I don't know a lot about Fleet, but I assume it doesn't recognize solution files, so it's probably unneeded oh, if it mentions that then sure So once you've created your project using dotnet new, navigate into the project directory, then run dotnet new sln and dotnet sln add . to create the solution file.
Itskillerluc
ItskillerlucOP2y ago
okay ill see maybe i dont need it
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server