Get File Extension of File Dropped Onto Windows Form [closed]
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . How can I capture the file extension of the file dropped onto a windows form? For example (pseudocode below) if extension = .xlsx { method1 } if extension = .txt { method2 } else { MessageBox.Show("Please drag/drop either a .xlsx or a .txt file"); } 回答1: You have to keep in mind that the user can drag more than