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

获取程序使用的文件名

发布时间: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。我好发给你

阅读全文

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

热点内容
cad坐标转换图文教程 浏览:397
苹果12原装数据线怎么感觉有点硬 浏览:764
js获取div中的图片不显示不出来 浏览:291
什么网站有首映动漫 浏览:461
淘宝网络电话叫什么 浏览:231
编程要读哪些书 浏览:134
如何在手机上新建文件夹里添文件 浏览:292
先锋w10刷安卓系统 浏览:787
java设置过期日期 浏览:114
新版本抖音怎么看我的数据比例 浏览:946
什么是3G网络3G的发展史 浏览:269
如何使用ps把图片的文件大小弄小 浏览:880
安卓系统根目录文件夹 浏览:900
手表怎么设置蜂窝网络 浏览:51
旧爱勾搭app还有吗 浏览:141
日外语言编程软件哪个好 浏览:950
小论文发表了但是数据错误怎么办 浏览:952
注册表禁止启动程序运行 浏览:705
网络优化总体流程图 浏览:735
前端程序员简历模板 浏览:706

友情链接