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

獲取程序使用的文件名

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

閱讀全文

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

熱點內容
ps3文件分割視頻 瀏覽:280
微信圖片一鍵轉發軟體 瀏覽:331
如何判斷s200plc編程電纜 瀏覽:691
太原編程培訓班哪個好 瀏覽:171
樹葉吹奏教程 瀏覽:6
社交app帶來了哪些社會問題 瀏覽:394
如何安裝愛寶8800數據採集器 瀏覽:712
文件保存了怎麼找不到了 瀏覽:476
彩票網站怎麼辨真假 瀏覽:840
pr找不到該文件 瀏覽:963
java移除panel 瀏覽:354
jsp填充jsp 瀏覽:166
海關外貿大數據在哪裡查 瀏覽:381
思特奇java筆試題 瀏覽:121
葫蘆俠在手機中的文件名 瀏覽:813
plc編程應該怎麼收錢 瀏覽:584
c語言中源文件由什麼組成 瀏覽:890
linuxhttpdphp配置文件 瀏覽:607
拆單數據要怎麼保存 瀏覽:17
mac電腦怎樣壓縮文件到100m 瀏覽:645

友情鏈接