Autor Beitrag
Bomania
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: Mo 10.02.03 23:09 
Hallo,

ich möchte einen Verweis auf eine Datei im Programmverzeichnis erstellen. Folgender Code müsste doch eigentlich einen Pfad wie "C:\Programme\Testproggi\test.txt" zurückliefern?

ausblenden Quelltext
1:
ExtractFilePath(ParamStr(0))+'test.txt'					


Was hab ich oben falsch gemacht?

Gruß
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 10.02.03 23:17 
Sag doch einfach, was passiert, vll. kann man Dir dann besser helfen.

Gruß
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mo 10.02.03 23:35 
Ich sehe keinen Fehler.
Jack Falworth
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 222

Win XP Pro, Slackware 10.0
D5 Enterprise, C++, ABAP
BeitragVerfasst: Mo 10.02.03 23:41 
probiers mal hiermit

ausblenden Quelltext
1:
ExtractFilePath (Application.ExeName) + 'test.txt'					


MfG

Jack Falworth

_________________
Andere zu kritisieren ist mitunter eine Möglichkeit, sich selbst ins bessere Licht zu setzen.
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: Mo 10.02.03 23:43 
Ich verwende eine Komponente namens HotLinkLabel, das als LinkLabel für URLs, eMails oder auch normale Dateien fungiert. Soweit funktioniert das LinkLabel. In meinem Hilfefenster wollte ich nun ein LinkLabel für eine kleine Hilfe.txt setzen. Diese befindet sich im Programmverzeichnis. Mit der oben beschriebenen Methode möchte ich nun den Pfad für die Datei festlegen:

ausblenden Quelltext
1:
hotlinklabel3.URL(ExtractFilePath(ParamStr(0))+'test.txt');					


Es passiert nichts - keine Fehlermeldung wenn ich auf den Link klicke. Es erscheint nur für eine Sekunde lang die Sanduhr. Wenn ich das Programm dann allerdings beende, dann erscheint ein "CPU-Fenster" mit irgendeinem Thread.
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: Di 11.02.03 00:11 
Solche Informationen gehören sofort an den Anfang. Versuch mal ein 'file:///' davorzusetzen, z.B.:

ausblenden Quelltext
1:
'file:///C:/Text.txt'					
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 11.02.03 09:30 
kann man überhaupt mit dem LinkLabel eine .txt öffnen? :?

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Di 11.02.03 09:36 
Hallo,

aber klar doch. Im Prinzip macht das Label nichts anderes als ShellExecute aufzurufen.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 11.02.03 09:38 
warum macht man es nich gleich mit ShellExecute ... ich wusste noch nich ma das es das Label gibt :D

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Di 11.02.03 14:45 
Hi,

Doxy hat Recht. Warum verwendest du nicht gleich ShellExecute - das Label ist dann nicht mehr nötig :wink:

AXMD
Bomania Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 139

Win XP

BeitragVerfasst: Di 11.02.03 18:35 
Weil das Label so schön die Farbe ändert wenn man drüber fährt :lol:

Nein im Ernst, ist eigentlich ne praktische Sache so ein multifunktionales Label für http, file, ftp, mail...