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

獲取程序使用的文件名

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

閱讀全文

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

熱點內容
nsa工具包usb 瀏覽:940
愛藏app開店怎麼收費 瀏覽:296
word文檔分節 瀏覽:131
徐州編程貓在哪裡 瀏覽:734
英語編程培訓哪個好 瀏覽:412
max文件放在哪裡 瀏覽:906
如何將不同列數據快速疊加成1列 瀏覽:883
文件控製程序培訓內容範本 瀏覽:16
數據處理中的銀行卡中心什麼意思 瀏覽:560
youku本地文件損壞 瀏覽:121
網站前台功能 瀏覽:560
qq空間動態關閉 瀏覽:796
手機里的文件夾哪些可以直接刪除 瀏覽:544
過億app 瀏覽:974
u盤文件夾被隱藏了怎麼找出來 瀏覽:72
文件夾名字顏色 瀏覽:607
女人適合學什麼編程 瀏覽:261
安卓通訊錄源代碼 瀏覽:13
魅藍X當前版本信息 瀏覽:426
英制18牙怎麼編程 瀏覽:964

友情鏈接