Autor Beitrag
TimonWorld
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Do 06.05.04 17:04 
Hi ich möchte ein proggi programmieren, dass die Dateiendung aus dem OpenDialog auslesen kann! Habe aber keinen Schimmer wie das geht! :cry:

:wink: Timon


Zuletzt bearbeitet von TimonWorld am Fr 14.05.04 20:02, insgesamt 1-mal bearbeitet
Manfred
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 90



BeitragVerfasst: Do 06.05.04 22:35 
Hi!
Meinst Du die Dateiendung der vom Anwender ausgewählten Datei?
Die befindet sich doch in der Eigenschaft OpenDialog1.FileName !

_________________
Computer können schneller rechnen als wir, deshalb machen sie auch mehr Fehler
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 09.05.04 13:17 
Ich will aber nur die Stellen hinter dem letzten punkt auslesen:

Beispiel:

Filename:
C:\TestPrg\top.index.html

Endung:
html
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 09.05.04 13:27 
ExtractFileExt aus der Unit SysUtils dürfte die Lösung zu deinem Problemchen sein


raziel

_________________
JSXGraph
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: So 09.05.04 13:29 
ExtractFileExt

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Mo 10.05.04 07:33 
und wie wende ich das an wenn ich im OpenDialog.OnCanClose den Code einfüge?
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 10.05.04 07:51 
im oncanclose? :?: rufe einfach diesen code auf dort wo du ihn brauchst...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  endung: String;

if OpenDialog1.Execute then // OpenDialog aufrufen
begin
  endung := ExtractFileExt(OpenDialog1.Filename);
  ShowMessage('Die ausgewählte Datei hat die Endung: ' + endung);
end else
  ShowMessage('Der Dialog wurde ohne Dateiauswahl geschlossen.');

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Fr 14.05.04 20:07 
THX - Es funzt!