need help how i can drag and drop to the Console app and Print the file i Drop
like get is Place?
i dont find nothing on google ... 🤐 🤐 🤐
like get is Place?
i dont find nothing on google ... 🤐 🤐 🤐
|
C#
C# drag and Drop to Console App , Get fille path |
|
I don't think it's possible to drag and drop on the console window. In the other hand, you can you drag and drop on the executable, then the file path will be as an argument.
Nov 11, 2019 04:21 PM
(This post was last modified: Nov 11, 2019 04:53 PM by dor343232.)
(Nov 11, 2019 04:19 PM)Neos07 Wrote: I don't think it's possible to drag and drop on the console window. In the other hand, you can you drag and drop on the executable, then the file path will be as an argument. Something like that if i am run the exe from CMD is working like Console.ReadLine(); and i get the Drag and drop file path if is not run from CMD like cmd /c is not working
Nov 11, 2019 07:20 PM
(This post was last modified: Nov 11, 2019 07:22 PM by gigajew.)
I think that's just built into cmd maybe you can replicate it with some windows api idk. Edit: yep right here https://stackoverflow.com/a/12662837
![]() (Nov 11, 2019 07:20 PM)gigajew Wrote: I think that's just built into cmd maybe you can replicate it with some windows api idk. Edit: yep right here c# - How do I get file paths of items dropped onto a console application window? - Stack Overflow sory but you worng in another PC VB C# is working on my PC is not something wried . .
Nov 12, 2019 12:24 PM
(This post was last modified: Nov 12, 2019 12:33 PM by 0xDEAD10CC.)
You do not understand how drag and drop operations work. Unless you're building your own terminal to handle the drag drop operation, your program code isn't going to have any effect on the command window. This is something that Microsoft has built into their own tool. Even if you have a program running in the cmd.exe, console applications don't run a message loop that can handle drag drop operations inherently.
The other part of this problem is with elevated UAC: https://superuser.com/a/59106
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Nov 12, 2019 03:16 PM
(This post was last modified: Nov 12, 2019 04:00 PM by Eternal Darkness.)
For all of you saying "console doesn't support drag & drop".
Code #include <vector>Easy conversion to C#: Code using System;I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
Nov 12, 2019 05:47 PM
(This post was last modified: Nov 12, 2019 05:49 PM by 0xDEAD10CC.)
(Nov 12, 2019 03:16 PM)Eternal Darkness Wrote: For all of you saying "console doesn't support drag & drop". If you knew the difference between OLE drag drop and the custom routine console's use, it's still a valid statement; they do not support it. It's not nearly as customizable... Why bother converting it to C# when you aren't willing to use any standard .NET code? All those string operations are incredibly inefficient.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Nov 12, 2019 06:46 PM
(This post was last modified: Nov 12, 2019 07:00 PM by Eternal Darkness.)
(Nov 12, 2019 05:47 PM)0xDEAD10CC Wrote: If you knew the difference between OLE drag drop and the custom routine console's use, it's still a valid statement; they do not support it. It's not nearly as customizable... Never said "it's the same". Just posted how to do it, while everyone was like "can't do it". Not my code, didn't optimize (specifically stated, referring to "Improvements"). POC I found which I converted to work for OP (in C#). Feel free to optimize, share, and open yourself up to an endless amount of criticism. 😏 I have learned not to post any "original code" here anymore as users tend to write books about how "you are a sh*tty coder" for an original POC to solve OP's issue, and will not focus on the OT/question/helping OP. I will optimize sh*t at work, but not likely to do it for the lot of ya anymore. 🙃 I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
(Nov 12, 2019 06:46 PM)Eternal Darkness Wrote: Never said "it's the same". Just posted how to do it, while everyone was like "can't do it". ALREDY did it i just 2 line .... is working THX for help all 🤝 (Nov 12, 2019 05:47 PM)0xDEAD10CC Wrote: If you knew the difference between OLE drag drop and the custom routine console's use, it's still a valid statement; they do not support it. It's not nearly as customizable... Considering he is the only one that actually helped solve the issue rather than just say it's not going to happen, I think it's rather rude (which majority of this section is) to say "Why bother", least he's actually helping answer the question.
Nov 13, 2019 02:29 PM
(This post was last modified: Nov 13, 2019 02:31 PM by 0xDEAD10CC.)
(Nov 13, 2019 07:52 AM)deiski Wrote: Considering he is the only one that actually helped solve the issue rather than just say it's not going to happen, I think it's rather rude (which majority of this section is) to say "Why bother", least he's actually helping answer the question. If you would prefer to help people who only want to copy and paste source code -- by all means, who's going to stop you? It's quite obvious to tell the difference. I help people all the time, and have been for the 9 years I've been on this forum. If he posted this on StackOverflow the most he would receive is a ton of negative votes, and no help.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Nov 13, 2019 02:44 PM
(This post was last modified: Nov 13, 2019 02:54 PM by Eternal Darkness.)
(Nov 13, 2019 02:29 PM)0xDEAD10CC Wrote: If you would prefer to help people who only want to copy and paste source code -- by all means, who's going to stop you? I want to help people learn. Few others here do. Can I push huge posts about how things are "designed" vs "the possibility" sure (I sure can rant). At the end of the day I would rather post a "solution"... I try to condense what I say, and provide an answer to the OT, rather than "you should do ___". I assume they have a reason for wanting said functionality. I can provide some method to Drag and Drop support, sure ("Ideal" prob not, but the method "would work" all the same. Rather hard to find "perfectly optimized" code in one quick google search...). (Nov 13, 2019 02:29 PM)0xDEAD10CC Wrote: It's quite obvious to tell the difference. I help people all the time, and have been for the 9 years I've been on this forum. Been here for 10 years. I help people all the time too, feel free to peruse my profile, maybe help diagnose some problems with users code/design more often (Rather than "bet you haven't even heard of Windows Kernel, you scrub", obviously intentionally not quoting you). Yet again, feel free to go around and optimize my code/whatever. (Nov 13, 2019 02:29 PM)0xDEAD10CC Wrote: If he posted this on StackOverflow the most he would receive is a ton of negative votes, and no help. Considering my link was from StackOverflow I kinda doubt it. Someone would have taken a literal minute to google and link him to that StackOverflow link (prob not have done the conversion but w/e I do what I want). Doesn't matter, even if that is the case, cuz we "can be" better than that. Apparently you feel differently though... I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
Nov 13, 2019 02:52 PM
(This post was last modified: Nov 13, 2019 02:58 PM by 0xDEAD10CC.)
(Nov 13, 2019 02:44 PM)Eternal Darkness Wrote: I want to help people learn. Few other here do. Can I push huge posts about how things are "designed" vs "the possibility" sure (I sure can rant). If you truly wanted to help people learn, then you need to understand the difference between providing completed work and giving them help/assistance. This is the point I'm getting at -- too many people think that the state of solving a thread is "helping", without taking into consideration that assistance/help is not the outcome but the process of getting to the resolution. You guys clearly don't understand that... And the difference between having this on StackOverflow and here, is that you've spoonfed him the C# version of it. Others there would have just linked it more likely leaving it up to him to conduct further research about HOW it works, and allowing him to learn on his own. That would be helping him by enabling him to do the work by providing him guidance. He also said that he didn't find anything on Google (which I also think is BS because he would have otherwise found the same link you did). If you haven't figured out that he's not looking for true help by now after replying to multiple threads posted by this member, then you'd have to be pretty naive.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Nov 13, 2019 03:05 PM
(This post was last modified: Nov 13, 2019 03:16 PM by Eternal Darkness.)
(Nov 13, 2019 02:52 PM)0xDEAD10CC Wrote: If you truly wanted to help people learn, then you need to understand the difference between providing completed work and giving them help/assistance. This is the point I'm getting at -- too many people think that the state of solving a thread is "helping", without taking into consideration that assistance/help is not the outcome but the process of getting to the resolution. I recently generally do (post "just" links), but that kinda depends on the skill level of the programmer/size of the request. Have received some criticism for it, but as long as there are well documented methods/user seems able-enough "to convert" for example. Helping him learn means providing a solution to the request, and hoping he takes some time understanding what you posted. If I posted C++ code alone I would receive both comments "pfft, that belongs in the C++ section not here" and also "How is C++ going to help with my C# program?". I'd rather just spend a few minutes "converting" it to usable code. If I were to link to java code in this subforum, I think some users (specially these 2 post accounts) would have trouble "with the conversion". Yet alone linking C++ code (to the impeccably bright OP/whoever), and expecting them to convert/take the time to understand without assistance in at-least making it usable in C#. Didn't "spoon-feed" that would mean I created this in a function/class for example. OP still has to figure out "what does what" in what I posted, and come up with a way to say read from the files. Me creating an optimized class(/integrating it for him) to Drag and Drop, that would be "spoon-feeding". Doesn't really matter at all as OP stated the issue is solved... I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
|
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [Python] by Beginner1234Nov 11, 2021 03:54 AM | 2 | 141 |
Nov 11, 2021 03:54 AM Last Post: 3phase |
| [C#] by PitbullT0rJun 15, 2021 03:39 AM | 5 | 312 |
Jun 15, 2021 03:39 AM Last Post: Mistercoenkel |
| [C#] by JettyOct 2, 2020 12:33 PM | 2 | 205 |
Oct 2, 2020 12:33 PM Last Post: xHeaven |