I want to know how to get numbe开发者_运维技巧r of files selected by mouse and throw it to args
.
so far I know "%1
" used to know file path.
static void main (string[] args)
{
string a = args[?] --> number of files selected
}
Could you be more specific?
First of all a static void main method is usually reserved for the start point of any .Net application. As explained in MSDN: "The Main method is the entry point of your program, where you create objects and invoke other methods. There can only be one entry point in a C# program."
Hence I find it hard to see how files selected by a mouse would be used here.
The args parameter is used for arguments entered when running the .exe of the application. As explained in MSDN: "The parameter of the Main method is a String array that represents the command-line arguments. Usually you check for the existence of the arguments by testing the Length property"
Command Line Arguments
For example: "DoWork.exe foo bar" In your application will resolve to args[0] = "foo" and args1 = "bar"
Number of arguments
args.Count()
The result for test.ext 1.txt hello.txt pay.txt
is 3
Go here if you mean manage files that has dragged to the application Window
精彩评论