Closed ivevkz closed 5 months ago
i don't understand what you're going to do.
Can you add more descriptions?
I'm making an application that will create directories of folders and I need to get the path from your application that is, I install my application into your application I go to any folder, right-click, select my application and then I need to get from your application the path to the root folder where the click was made, and transfer it to my application in order to create my own folders I hope you understand)
What type of application, uwp or win32? Can you add some screenshots?
here I tried to get the path via json
yes win32
This doesn't work the arguments are dynamically generated and then passed in via the startup arguments which need to be received in the main method
https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/main-command-line
Program.cs
namespace PathTest
{
internal static class Program
{
[STAThread]
static void Main(string[] args) //read path from here
{
ApplicationConfiguration.Initialize();
Application.Run(new Form1(args.FirstOrDefault("no args")));
}
}
}
Form1.cs
namespace PathTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form1(string path)
{
InitializeComponent();
label1.Text = path;
}
}
}
Test
PathTest.exe test
Menu
{
"title": "Win Form Test",
"exe": "\"F:\\PathTest.exe\"",
"param": "\"{path}\"",
"icon": "\"F:\\PathTest.exe\",0",
"index": 0,
"acceptDirectory": true,
"acceptExts": "*",
"acceptFileFlag": 1,
"acceptFileRegex": "",
"acceptMultipleFilesFlag": 0,
"pathDelimiter": "",
"paramForMultipleFiles": ""
}
thanks
it worked, I couldn't do it for a week, thank you very much
hi, I'm a novice programmer, I don't understand how to get the path of the folder where the click was made I need to get the path so that I can then work with it in visual studio C# I tried using json and the path parameter, but something doesn’t work, or I’m doing something wrong, please tell me Thank you!