导航:首页 > 文件类型 > 获取程序使用的文件名

获取程序使用的文件名

发布时间:2023-06-09 21:16:35

1. c语言如何获取运行程序的自身文件

#include<stdio.h>
#include<string.h>

intmain(intargc,char*argv[]){
char*FileDP=argv[0];
printf("%s ",FileDP);
char*FileName=strrchr(FileDP,'\')+1;
printf("%s ",FileName);//Here'sFileName.
}

2. 用批处理命令获取文件夹名称

1、在电脑中新建一个文本文档,双击打开该文档。

3. 怎样用vb获取exe自身的文件名

Dim str As String
str = IIf(Len(App.Path) > 3, App.Path & "\" & App.EXEName & ".exe", App.Path & App.EXEName & ".exe") str 就是EXE文件的路径了。搞这么复杂是因为当EXE文件在根目录下的时候,app.path 是带有“\”,不在根目录下的时候没有。

4. c#如何获取当前运行程序的文件名

string strFullPath = Application.ExecutablePath;
string strFileName = System.IO.Path.GetFileName ( strFullPath );

5. 怎样用fortran获取一个文件夹里的所有文件名

天河流纹石,回答的答案挺好,但是有bug。

网页链接这个链接就是他答案的来源,按照帖子说明,测试基本成功,稍有问题。其中bug怎么解决,刚刚给回了帖子。

再次感谢

zxcvbno

为了后来者用起来方便,把完整消除bug的代码如下所示。

! get_file_name.f90

! functions:

! get_file_name - entry point of console application.

!

!****************************************************************************

!

! program: get_file_name

!

! purpose: entry point for the console application.

!

!****************************************************************************

program get_file_name

implicit none

external writename

integer :: n

call dowithwildcard( '*.*' , writename , n )

if ( n >= 0 ) then

write(*,*) '共' , n , '个文件!'

end if

end program get_file_name

subroutine dowithwildcard(cwildcard,callback,itotal)

use dflib,only:getfileinfoqq,getlasterrorqq,file$info,file$last,file$error,file$first,err$nomem,err$noent,file$dir

implicit none

interface

subroutine callback( filename , loop )

character(*),intent(in) :: filename

integer,intent(in) :: loop

end subroutine callback

end interface

character*(*),intent(in)::cwildcard

integer,intent(out)::itotal

type (file$info) info

integer(4)::wildhandle,length,retint

character(100) :: lastname

wildhandle = file$first

itotal = 0

do while (.true.)

length = getfileinfoqq(cwildcard,info,wildhandle)

if ((wildhandle .eq. file$last) .or.(wildhandle .eq. file$error)) then

select case (getlasterrorqq())

case (err$nomem) !//内存不足

itotal = - 1

return

return

itotal = 0

return

end select

end if

if ((info%permit.and.file$dir).eq.0) then

if(trim(info.name) .eq. trim(lastname)) return

lastname = trim(info.name)

call callback( trim(info.name) , itotal + 1 )

itotal = itotal + 1

end if

end do

end subroutine dowithwildcard

subroutine writename( filename , loop )

character(*),intent(in) :: filename

integer,intent(in) :: loop

write(*,*) loop , filename

end subroutine writename

6. 客户端winform程序获取服务器指定路径下所有文件名,能直接下载过来更好,服务器运行.ASP程序

winform是CS结构。所以说像这样的程序你必须要用个服务端。当然哪如果你是用FTP的话就可以不要了。但服务器上必须开启ftp服务来响应你的客户端要求FTP的就不讲了。你上网查个FTP的例子就可以了。如果是自己搞服务端可以用远程对象来实现意思就是这个类在服务端实例一个出来专门用于执行的。客户端只要调用就行了。结果会返回给客户端的。如果你要样例请给我你的QQ。我好发给你

阅读全文

与获取程序使用的文件名相关的资料

热点内容
nsa工具包usb 浏览:940
爱藏app开店怎么收费 浏览:296
word文档分节 浏览:131
徐州编程猫在哪里 浏览:734
英语编程培训哪个好 浏览:412
max文件放在哪里 浏览:906
如何将不同列数据快速叠加成1列 浏览:883
文件控制程序培训内容范本 浏览:16
数据处理中的银行卡中心什么意思 浏览:560
youku本地文件损坏 浏览:121
网站前台功能 浏览:560
qq空间动态关闭 浏览:796
手机里的文件夹哪些可以直接删除 浏览:544
过亿app 浏览:974
u盘文件夹被隐藏了怎么找出来 浏览:72
文件夹名字颜色 浏览:607
女人适合学什么编程 浏览:261
安卓通讯录源代码 浏览:13
魅蓝X当前版本信息 浏览:426
英制18牙怎么编程 浏览:964

友情链接