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

獲取程序使用的文件名

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

閱讀全文

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

熱點內容
淘寶網路電話叫什麼 瀏覽:231
編程要讀哪些書 瀏覽:134
如何在手機上新建文件夾里添文件 瀏覽:292
先鋒w10刷安卓系統 瀏覽:787
java設置過期日期 瀏覽:114
新版本抖音怎麼看我的數據比例 瀏覽:946
什麼是3G網路3G的發展史 瀏覽:269
如何使用ps把圖片的文件大小弄小 瀏覽:880
安卓系統根目錄文件夾 瀏覽:900
手錶怎麼設置蜂窩網路 瀏覽:51
舊愛勾搭app還有嗎 瀏覽:141
日外語言編程軟體哪個好 瀏覽:950
小論文發表了但是數據錯誤怎麼辦 瀏覽:952
注冊表禁止啟動程序運行 瀏覽:705
網路優化總體流程圖 瀏覽:735
前端程序員簡歷模板 瀏覽:706
蜂巢積木編程機器人怎麼樣 瀏覽:561
微信小程序tips 瀏覽:117
油印文件有哪些 瀏覽:854
java線程買票案例 瀏覽:672

友情鏈接