導航:首頁 > 文件類型 > 獲取程序使用的文件名

獲取程序使用的文件名

發布時間: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。我好發給你

閱讀全文

與獲取程序使用的文件名相關的資料

熱點內容
Linux配置yum本地文件庫 瀏覽:909
oracle資料庫用什麼資料 瀏覽:390
比較成功的網路廣告 瀏覽:750
復制文件找不到復制路徑 瀏覽:391
java運行原理 瀏覽:558
買韓星周邊用什麼app 瀏覽:517
ps自動生成的文件格式 瀏覽:232
mac應用程序打不開了 瀏覽:836
qq飛車手游內測版下載地址 瀏覽:927
中文網站翻譯成俄語多少錢 瀏覽:107
文件名加標題 瀏覽:644
共享數據怎麼被凍結了 瀏覽:150
如何登記考勤數據 瀏覽:640
蘋果6s前置照片效果 瀏覽:171
企業微信素材庫文件下載鏈接 瀏覽:582
pdf文件怎麼取消標黃 瀏覽:781
打電話時不能使用網路是什麼原因 瀏覽:919
ps怎麼將文件合並 瀏覽:747
java的日期格式化 瀏覽:981
電腦應用程序怎麼關 瀏覽:986

友情鏈接