ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] GetBaseName(Me)

[µo°Ý] GetBaseName(Me)

¥»©«³Ì«á¥Ñ yangjie ©ó 2010-11-5 17:28 ½s¿è

½Ð±Ðª©¤j©Î¦U¦ì¥ý¶i:
  À³¦p¦ó¨ú±o  µøµ¡°õ¦æÀÉ   ÀɦW
     am=GetBaseName(Me)
     MSGBOX   am  
      ' ¶Ç¦^ VB5.EXE ªº VB5
    ¿ù»~: Me ÃöÁä¦r¤£¯à¥X²{¦b¤@¯ë¼Ò²Õ¤¤¡C
   ½Ð±Ðª©¤j©Î¦U¦ì¥ý¶i¡A­Ó¤H¤S«D±o¦b¤@¯ë¼Ò²Õ¤º°õ¦æ¡CÀ³¦p¦ó¸Ñ¨M?
           ©Î¬O­×§ï¦¨Me¬°.......??????
ÁÂÁÂ

RE: myGetProcessIdFileName(Me.hWnd)

¥»©«³Ì«á¥Ñ yangjie ©ó 2010-11-5 17:31 ½s¿è

¦^´_ 1# yangjie
¦U¦ì¤j¤j:
¹ï¤£°_
   ­ì¥ý«e "myGetProcessIdFileName"»yªk¬O¿ùªº(¥i¯à¨S¦³¨ç¼Æ"myGetProcessIdFileName")
§Ú¥u¬O·Q¥ÎVB ¼g¥X¤@¬q  µM«áÂন°õ¦æÀÉ  ¨Ò¦pÂন  "¿é¤J¸ê®Æ.exe "
°õ¦æ®É ·|msgbox¼u¥XÀɦW "¿é¤J¸ê®Æ"
­Y±N"¿é¤J¸ê®Æ.exe " rename  ¦¨ "µn¿ý.exe "
°õ¦æ®É ·|msgbox¼u¥XÀɦW "µn¿ý"
Àµ½Ð½Ñ¦ì¤j¤j¨ó§U
¨ã³o¼Ë¥\¯à¤§VB»yªk?? ¦p¦ó¶Ç¦^¦Û¨­ÀɦW?????

TOP

App.EXEName

ÁÙ¦³ ­n¶Ç¥~³¡°Ñ¼Æ¶i¥h ¤£¬O³o¼Ë°µªº
¦]¸Ó¬O­n¥ÎCommand

Command¬Oµ{¦¡¤º±µ¦¬ªº¨ç¼Æ
±N±z¥]¦nªºµ{¦¡ «Ø¥ß±¶®|
±¶®|¸ô®|´N·|ªº­È ´N¬O¶Ç¤J­È¤F
¦p¥H¤U½d¨Ò ¶Ç¤J­È´N¬O"§Ú·R³Â»¶®a±Ú"
"C:\Project1.exe" §Ú·R³Â»¶®a±Ú
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¦^´_ 3# Min

·P¿E±zªº¦^À³
       ­Ó¤H©|¦b²z¸Ñ¤¤
    §Úªº¥Dµ{¦¡¦p¤U: §Ú·Q¦b  04    Set f = fso.GetFile("µn¿ý.xls")  ¤¤¶Ç¦^¥»µ{¦¡Âন¤§***.exeÀɪºBaseName
         ³o¼Ë¤l´N¥i¥H¥Î°Ñ¼Æ¥Nªí²Ä9¦æªºÀɦW
½Ð±ÐÀ³¦p¦ó­×§ï²Ä4¦æ? ÁÂÁÂ
01    Sub Main()
02    Dim fso, f As Object
03    Set fso = CreateObject("Scripting.FileSystemObject")
04    Set f = fso.GetFile("µn¿ý.xls")
05    Dim n
06    n = fso.GetParentFolderName(f.Path)
07    Set objXLApp = CreateObject("Excel.Application")
08    objXLApp.Visible = True
09    Set objXLBook = objXLApp.Workbooks.Open(n & "\µn¿ý.xls")
10    Set objXLBook = Nothing
'    objXLApp.Quit
11    Set objXLApp = Nothing
12    Set fso = Nothing
13    Set n = Nothing
14    Set f = Nothing
15    End Sub

TOP

OK ¤F ´ú¸Õ¦¨¥\
·P¿E Min
¯uªº¬O¥[¤W f1 = App.EXEName    f1 ´N¬OBaseName
    Dim f1
    f1 = App.EXEName
    Dim fso, f As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFile(f1 & ".xls")
¯u¬O¤Ó´Î¤F

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD