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

獲取程序使用的文件名

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

閱讀全文

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

熱點內容
qlv文件放在桌面找不到 瀏覽:199
卓易彩票app 瀏覽:743
js獲取游標 瀏覽:701
發送的文件怎麼找不到 瀏覽:324
cad文件欄和工具欄都不見了 瀏覽:102
看圖識建築app 瀏覽:398
word2020文件類型默認擴展名 瀏覽:194
時代少年團的圖片在哪個app 瀏覽:350
康平網站建設值多少錢 瀏覽:642
怎樣把word分頁 瀏覽:135
javareplaceall替換不了 瀏覽:985
widgetsjstwitter 瀏覽:556
如何做一個工會網站 瀏覽:694
javascript轉化為數值 瀏覽:173
l3agent配置文件 瀏覽:521
element3d文字教程 瀏覽:434
pages文件能在word里打開么 瀏覽:53
金鏟鏟配置文件下載失敗客戶端無法啟動 瀏覽:387
c按行讀取word 瀏覽:310
4g網路怎麼變成2g了 瀏覽:197

友情鏈接