C
C#xp4eternity

2 Questions

Hi, I need to ask 2 questions as i am new to C#. So im missing 2 tasks to deploy my first app. And ive been struggling to find help on Youtube for my concerns. My first question. how can i give a button 2 events. for example "If radioButton_1 is selected, process.start <File X>" "if radioButton_2 is selected, process.start <File Y>" how can i do that? My second question is how can i give a file directory template. in an example C:%filelocation%%filepath% something around those lines. Help Appreciated!
A
Angius160d ago
1. Bind to the click event of the radio button and add whatever code you wish 2. Do you want to create a path dynamically, or get a "universal" path, for example to user desktop no matter who the user is?
X
xp4eternity160d ago
2. to user desktop
A
Angius160d ago
Environment.GetFolderPath(EnvironmentFolders.SpecialFolder.Desktop) I believe https://learn.microsoft.com/en-us/dotnet/api/system.environment.specialfolder?view=net-8.0 https://learn.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=net-8.0 I was not correct in my beliefs there, fixed it
X
xp4eternity160d ago
is there a microsoft learn link for the first. i still dont get it. or an example.
A
Angius160d ago
That is the link SpecialFolder is an enum It contains values like .Desktop Using the method from the second link, you can turn that into a path So Environment.GetFolderPath(EnvironmentFolders.Desktop) becomes C:/Users/zp4eternity/Desktop/ Then just use Path.Combine() to append more path segments if needed
X
xp4eternity159d ago
still struggling for the bind to the....
Want results from more Discord servers?
Add your server
More Posts
Raw SQL Query QuestionI have a raw SQL query that I need to execute against a database that's external to my application. ✅ Help for unityGood evening I am looking for someone who can teach me how to create a game from A to Z. Even if I dAny way to get XAML Auto-complete in VS Code?I recognize this isn't quite a C# question, but it's related. I want to make cross platform apps usi.Net 8 Blazor Web App Identity Framework HelpSuper quick overview: I have a Blazor Web App that is single process only hosting UI. It communicaRegex Group Containshey simple easy question, but are there ways to access individual capture groups in a regex match? I"netsh" cmd Commands not being executedWell, I am trying to set up some firewall-rules and such, the problem is non of the commands is beinAutomate the process of transferring a Microsoft SQL Server .bak file to MongoDBI'm looking to automate the process of transferring a Microsoft SQL Server backup file (e.g., bulk.bMapping controller to / without breaking other controllersHi there, I would like to rename `HomeController` to `DefaultController` and instead of going to `/helpwhy is doesn't workTrack Thread/Task Progress through SignalR/WebSocketsI have an ASP.NET Web Core API and an Angular project both connected. In the dashboard of my Angularazor pages vs .cshtmlTeam , What is the difference between razor pages and cshtml.? razor pages looks like old asp.net w✅ mobile applicationMy question is quite fundamental, the way I imagine mobile apps is that they utilize an API to conneIt's not showing the database in datagridviewI'm having trouble trying to show the database that the teacher gave me and the demo she gave me to Can't seem to make a universal filepathHi there could anyone explain how I can make a universal filepath so other pc's can locate the fileshey! looking for fellow C# noobs!Does anyone want to vc and group study,go over things etc? No dumb questions or rudeness I'm alsl beStuttering in UI and I don't know whyEverytime I launch the app, the very first time I navigate to any FlyoutItem I get this stuttering iIssue with Filtering in DataGridI use Telerik UI's DataGrid control for .Net Maui. As you see VIPStatus column holds values such as Minimum Required Knowledge before I am job ready.Hello guys, I want to know this info from someone that has work experience. What is minimum requiredAsssembly Version WrongIt was working for a little bit, but now it's displaying `v1.0.0-alpha+9fb67d6af368e6cd5a05c8f401327enum HasFlagI would've thought this would return true, but it's false. How can I fix this logic to return true f