Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Valid Path in URL

106 views
Skip to first unread message

Félix GUILLEMOT

unread,
Jul 31, 2003, 2:01:02 PM7/31/03
to
Does someone knows a function that tells if a path (+document) contains
invalid characters ?
ex : /myPath/Mydoc.htm
is correct but
/mypath/scrollbars=yes,width=420,height=400
or /my-č((č-_path/doc.htm
or /hkjh'(-"'(-"'(-ůů^**/*$ů$'(-'"(-'ykjhfhgf.doc
is not correct i think, but how to determine a rule ?

I know that \ is not valid character but what are the others ?

Maynard Philbrook

unread,
Jul 31, 2003, 2:43:15 PM7/31/03
to
you shouldn't be getting garbage like that unless you are not clearing a
string or something.
examine your code and make what ever string type your using to get the
path is first cleared, then call what ever code your using to define what
should be a valid path.

"Félix GUILLEMOT" wrote:

--
To See what real programmers do in their spare time visit
http://jamie12.home.mindspring.com
home of PC bit software ..
Please send comments about my work .


DoesntMatter

unread,
Jul 31, 2003, 4:22:48 PM7/31/03
to

Hi,
Im sure theres a more elegant way to solve this but this is what came to my mind:

for i := 0 to Length(path) -1 do
if path[i] = 'invalid_character' then warning....

Michael Fritz

unread,
Aug 1, 2003, 3:01:31 AM8/1/03
to
> Does someone knows a function that tells if a path (+document) contains
> invalid characters ?
Félix,

there is a function in shlwapi.dll which should fit your need: PathIsURL
I'm using this function this way:

function IsPathURL(const S: string) : boolean;
// Tests a given string to determine if it conforms to a valid URL format.
begin
Result := False;
try
Result := PathIsURL(PChar(S));
except
end;
end;

BTW I'm using ShLwapi.pas converted by Marcel van Brakel.

cu,
Michael


Félix GUILLEMOT

unread,
Aug 1, 2003, 4:14:31 AM8/1/03
to
is it a joke ?

"DoesntMatter" <no...@here.yet> a écrit dans le message de news:
3f297a98$1...@newsgroups.borland.com...


>
> Hi,
> Im sure theres a more elegant way to solve this but this is what came to
my mind:
>
> for i := 0 to Length(path) -1 do
> if path[i] = 'invalid_character' then warning....
>
>
> "Félix GUILLEMOT" <felix.g...@beaconseil.com> wrote:
> >Does someone knows a function that tells if a path (+document) contains
> >invalid characters ?
> >ex : /myPath/Mydoc.htm
> >is correct but
> >/mypath/scrollbars=yes,width=420,height=400

> >or /my-è((è-_path/doc.htm
> >or /hkjh'(-"'(-"'(-ùù^**/*$ù$'(-'"(-'ykjhfhgf.doc

Félix GUILLEMOT

unread,
Aug 1, 2003, 4:13:46 AM8/1/03
to
hello,

Thank you very much (danke sehr ?) for your quick reply on newsgroups

>BTW I'm using ShLwapi.pas converted by Marcel van Brakel.

But where an i find this unit ? I don't have it with D5 sources.
Can you eventually send it to me ?

no_spamfeli...@beaconseil.com

"Michael Fritz" <spam_...@yahoo.de> a écrit dans le message de news:
3f2a104a$1...@newsgroups.borland.com...

Daaron

unread,
Aug 1, 2003, 10:41:20 AM8/1/03
to
Available on the Jedi site (http://www.delphi-jedi.org) in the API section

"Félix GUILLEMOT" <felix.g...@beaconseil.com> wrote in message
news:3f2a21be$1...@newsgroups.borland.com...

0 new messages