本文介绍了如何获得* .extension名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我正在创建带有自定义文件扩展名的Windows窗体项目。

我想要的是当我双击带有新文件扩展名的图标时,获取文件名和文件路径。

示例:

Hello. I am creating Windows Form project with custom file extension.
What I want is when I double click an icon with the new file extension, to get the filename and filepath.
Example:

C:\TestDB\NewDatabase2\NewDatabase2.abc



我需要获取路径:


I need to get the path:

C:\TestDB\NewDatabase2



我还需要文件名:


I need also the filename:

NewDatabase2.abc





我尝试了什么:



我试过的东西喜欢:



What I have tried:

I have tried things like:

System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase




System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)



我只获取.exe名称。


I am only getting the .exe name.

推荐答案



这篇关于如何获得* .extension名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 21:04