Q&A
HOME
Tips & Tech
Q&A
Discuss
Download
자유게시판
홍보 / 광고
구인 / 구직
LOGIN
회원가입
url이 살았는지 죽었는지 알아내는 방법이 궁금합니다.
질문 그대로 입니다.
url을 주어서 그 url이 살았는지 죽었는지 알고 싶습니다.
한수 가르쳐 주세염.
그럼 ^^;
i believe i can fly~~
2
COMMENTS
구창민
•
2001.09.15 05:30
irookie wrote:
> 질문 그대로 입니다.
>
> url을 주어서 그 url이 살았는지 죽었는지 알고 싶습니다.
>
> 한수 가르쳐 주세염.
>
> 그럼 ^^;
>
> i believe i can fly~~
안녕하세요~~ 구창민입니다.
아래는 URL이 유효한지 검사하는 예제입니다.
참고하시고, 항상 즐거운 프로그래밍 하시길~~~~~
Checking URL Sample
// Author: Greg Holowatinc (MetZ = nwillams@telusplanet.net)
// Co-Author: David Turner (Leapix = leapix@dal.net)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function IsUrl(S: string): Boolean;
const
// First off we set a few characters that cannot
// exist in any given case.
// These can be modified right here without penalty.
BADCHARS = ';*<>{}[]|()^!';
var
//We then set a few integers as our variables - mostly counter stuff.
p, x, c, count, i: Integer;
begin
//First thing we do is go the negative way.
// so set result to false
Result := False;
//The length has to be greater than 5 and stuff
// like www.myhouse. or www..hello cannot
//exist - so we rule out these right here.
if (Length(S) > 5) and (S[Length(S)] <> '.') and (Pos(S, '..') = 0) then
begin
//The first initial test has passed. Now we sort through
//the bad chars using a counter.
for i := Length(BADCHARS) downto 1 do
if Pos(BADCHARS[i], S) > 0 then
System.Exit;
//Anything below CHR33 and above CHR126 is crap when it comes to internet links.
for i := 1 to Length(S) do
if (Ord(S[i]) < 33) or (Ord(S[i]) > 126) then
System.Exit;
//Ok, first we look at the domain names. Make sure they fit the minimal template.
if ((Pos('www.',LowerCase(S)) = 1) and
(Pos('.', Copy(S, 5, Length(s))) > 0) and
(Length(S) > 7)) or
//A news thing is very similar, so we include it in the OR statement.
((Pos('news:', LowerCase(S)) = 1) and
(Length(S) > 7) and
(Pos('.', Copy(S, 5, Length(S))) > 0))
then
begin
//Naturally, if all goes well and the test is passed, we end
//the seek right there.
Result := True;
System.Exit;
end
//This is the mail section - and it will recognize any email addresses found.
else if ((Pos('mailto:', LowerCase(S)) = 1) and (Length(S) > 12) and
(Pos('@', S) > 8) and (Pos('.', S) > 10) and
(Pos('.', S) > (Pos('@', S) +1))) or
((Length(S) > 6) and (Pos('@', S) > 1) and (Pos('.', S) > 4) and
(Pos('.', S) > (Pos('@', S) +1)))
then
begin
Result := True;
System.Exit;
end
//An extention of all www. stuff is here with the browser headers included.
else if ((Pos('http://', LowerCase(S)) = 1) and
(Length(S) > 10) and
(Pos('.', S) > 8)) or
((Pos('ftp://', LowerCase(S)) = 1) and
(Length(S) > 9) and (Pos('.', S) > 7))
then
begin
Result := True;
System.Exit;
end
else
begin
// So we have passed all of the word types. Now its time to see
// if the thing contains numbers in such format as a numeric ip would be.
Result := True;
for Count := 1 to 4 do
begin
p := Pos('.',S) - 1;
if p < 0 then
p := Length(S);
Val(Copy(S, 1, p), x, c);
if ((c <> 0) or (x < 0) or (x > 255) or (p>3)) then
begin
Result := False;
Break;
end;
Delete(S, 1, p + 1);
end;
if (S <> '') then
Result := False;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if not IsURL(Edit1.Text) then
Showmessage('유효하지 않은 URL 입니다');
(* Checking URL Sample
1. www.leapware.com
2. http://www.leapware.com
3. nwillams@telusplanet.net
4. mailto:nwillams@telusplanet.net
3. news:alt.why.do.i.bother
4. ftp:://ftp.microsoft.com
5. 192.168.0.1
*)
end;
end.
0
0
삭제
수정
댓글
stoney
•
2001.09.15 02:58
해당 URL로 Ping 때려보시면 되죠.. ^^
irookie wrote:
> 질문 그대로 입니다.
>
> url을 주어서 그 url이 살았는지 죽었는지 알고 싶습니다.
>
> 한수 가르쳐 주세염.
>
> 그럼 ^^;
>
> i believe i can fly~~
0
0
삭제
수정
댓글
(NOTICE) You must be
logged in
to comment on this post.
강호규
•
2001.09.15 05:40
4
COMMENTS
/
0
LIKES
오라클의 DATE 타입이 왜 널로만 읽힐까요?
쥐 <:( ) ~
•
2001.09.15 17:49
강호규 wrote: > 오라클에서 > 필드 타입은 DATE 입니다. > DB에는 분명 데이터가 들어 있고 > 오라클 ...
강호규
•
2001.09.15 17:53
오라클 관련자료를 올립니다. 특이한 것은 테이블명,필드명 모두 한글로 되어 있습니다. 감사합니다. ...
쥐 <:( ) ~
•
2001.09.15 18:23
강호규 wrote: > 오라클 관련자료를 올립니다. > 특이한 것은 테이블명,필드명 모두 한글로 되어 있습니...
강호규
•
2001.09.15 18:29
쥐 강호규 wrote: > > 오라클 관련자료를 올립니다. > > 특이한 것은 테이블명,필드명 모두 한글로 되어...
왕초보
2001.09.15 05:21
0
COMMENTS
/
0
LIKES
이것좀 봐주세요(콤보박스...)
왕초보
•
2001.09.15 05:08
3
COMMENTS
/
0
LIKES
타이머사용에 대해서(꼭 답변 해주세요...)
이장렬
•
2001.09.15 05:42
왕초보 wrote: > Lb_timer.Caption := TimeToStr(Now) > 이렇게 써서 현재시각을 얻었는데요... > 이...
왕초보
•
2001.09.15 07:42
넘넘 감사합니다....해결했어용...ㅋㅋㅋ 열시미 공부할께요.....*^^*
이장렬
•
2001.09.15 05:42
왕초보 wrote: > Lb_timer.Caption := TimeToStr(Now) > 이렇게 써서 현재시각을 얻었는데요... > 이...
한철
2001.09.15 05:03
0
COMMENTS
/
0
LIKES
RxRichEdit에서TBlobStream를이용해서 입력,출력하는방법(이미지포함)
김춘성
2001.09.15 04:44
0
COMMENTS
/
0
LIKES
[소스입수] 이 VC++ 소스를 델파이로 바꾼다면...
바보감자
2001.09.15 03:55
0
COMMENTS
/
0
LIKES
ADO콤포..MS SQL2000 사용할때 버그(EOF)나는거..고치는 방법좀..
알려주셔요
2001.09.15 03:32
0
COMMENTS
/
0
LIKES
AtiveX에 대한 질문입니다.
급합니다...꼭
•
2001.09.15 03:08
2
COMMENTS
/
0
LIKES
컴퓨터에 설치된 오라클 클라이언트의 버젼을 알 수 있는 방법을 좀 알려주십시오.
아폴론
•
2001.09.15 03:22
SQL Plus로 접속해서 메뉴중 도움말을 크릭하세요 급합니다...꼭 wrote: > 안녕하세요. > > 컴퓨터...
급합니다...꼭
•
2001.09.15 19:32
아폴론 wrote: > SQL Plus로 접속해서 메뉴중 도움말을 크릭하세요 > > 급합니다...꼭 wrote: > > 안...
궁금
2001.09.15 01:54
0
COMMENTS
/
0
LIKES
인터베이스에 연결이 안되요...
이원택
2001.09.15 01:33
0
COMMENTS
/
0
LIKES
F1Book에서 위에 Fix된 Row에 관한 질문 입니다.
뛰는초보
•
2001.09.15 01:26
1
COMMENTS
/
0
LIKES
스트링 그리드 셀에 두줄로 보이는 방법좀..
stoney
•
2001.09.15 03:02
WordWrap 기능 비슷하게 구현은 가능 하겠네요.. procedure TMainForm.StringGrid1DrawCell(Sender: TOb...
irookie
•
2001.09.15 01:18
2
COMMENTS
/
0
LIKES
url이 살았는지 죽었는지 알아내는 방법이 궁금합니다.
질문 그대로 입니다. url을 주어서 그 url이 살았는지 죽었는지 알고 싶습니다. 한수 가르쳐 주세염. 그럼 ^^; i believe i can fly~~
구창민
•
2001.09.15 05:30
irookie wrote: > 질문 그대로 입니다. > > url을 주어서 그 url이 살았는지 죽었는지 알고 싶습니다. ...
stoney
•
2001.09.15 02:58
해당 URL로 Ping 때려보시면 되죠.. ^^ irookie wrote: > 질문 그대로 입니다. > > url을 주어서 그...
새까만넘
•
2001.09.15 01:11
3
COMMENTS
/
0
LIKES
해당하는 데이타가 있는지 확인하는법...
Lost July
•
2001.09.15 01:27
for i := 1 to 10 do if not (i in [5, 6, 7]) then {여기에 Insert 문 삽입} 하시면 됩니다.
새까만넘
•
2001.09.15 01:32
Lost July wrote: > for i := 1 to 10 do > if not (i in [5, 6, 7]) then > {여기에 Insert 문 ...
aparadin
•
2001.09.15 01:55
새까만넘 wrote: > Lost July wrote: > > for i := 1 to 10 do > > if not (i in [5, 6, 7]) then > ...
문철민
•
2001.09.15 00:37
1
COMMENTS
/
0
LIKES
DB연결
$
•
2001.09.15 01:46
문철민 wrote: > > * 사용환경 : 델파이4 / Windows me > > > 델파이를 처음 접해보는 사람입...
손님
•
2001.09.15 00:31
1
COMMENTS
/
0
LIKES
계산기만들기에 대하여
aparadin
•
2001.09.15 02:01
내용무랬져^^;;;;;;;;;;;;;;
소비연
•
2001.09.15 00:27
1
COMMENTS
/
0
LIKES
레포트 출력시 미리보기 하지 않고 바로 출력은 어떻게 하나요?
Lost July
•
2001.09.15 00:28
form1.quickrep1.print; -> 기본 프린터로 바로 출력 form1.quickrep1.preview; -> 미리보기
Lost July
2001.09.15 00:26
0
COMMENTS
/
0
LIKES
어플리케이션 서버를 만들때..
바보
•
2001.09.15 00:19
1
COMMENTS
/
0
LIKES
(질문) 테이블의 indexname 과 indexfieldname의 차이점
bibic
•
2001.09.15 02:02
테이블에 aa라는 필드가 있다면 이 필드에 인덱스를 aa_idx라는 이름으로 생성한다고 한다면... aa_id...
민
•
2001.09.14 23:47
1
COMMENTS
/
0
LIKES
타이머를 첨 써봐요..
홍성락
•
2001.09.14 23:58
민 wrote: > 안녕하세요. > 타이머를 거의 처음써봐서요.. > 레이블을 깜박깜박하게 만들려구 하는데 ...
스파토이
2001.09.14 23:41
0
COMMENTS
/
0
LIKES
이것쩜 해석해주이소...
irookie
2001/09/15 01:18
Views
155
Likes
0
Comments
2
Reports
0
Tag List
수정
삭제
목록으로
한델 로그인 하기
로그인 상태 유지
아직 회원이 아니세요? 가입하세요!
암호를 잊어버리셨나요?
> 질문 그대로 입니다.
>
> url을 주어서 그 url이 살았는지 죽었는지 알고 싶습니다.
>
> 한수 가르쳐 주세염.
>
> 그럼 ^^;
>
> i believe i can fly~~
안녕하세요~~ 구창민입니다.
아래는 URL이 유효한지 검사하는 예제입니다.
참고하시고, 항상 즐거운 프로그래밍 하시길~~~~~
Checking URL Sample
// Author: Greg Holowatinc (MetZ = nwillams@telusplanet.net)
// Co-Author: David Turner (Leapix = leapix@dal.net)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function IsUrl(S: string): Boolean;
const
// First off we set a few characters that cannot
// exist in any given case.
// These can be modified right here without penalty.
BADCHARS = ';*<>{}[]|()^!';
var
//We then set a few integers as our variables - mostly counter stuff.
p, x, c, count, i: Integer;
begin
//First thing we do is go the negative way.
// so set result to false
Result := False;
//The length has to be greater than 5 and stuff
// like www.myhouse. or www..hello cannot
//exist - so we rule out these right here.
if (Length(S) > 5) and (S[Length(S)] <> '.') and (Pos(S, '..') = 0) then
begin
//The first initial test has passed. Now we sort through
//the bad chars using a counter.
for i := Length(BADCHARS) downto 1 do
if Pos(BADCHARS[i], S) > 0 then
System.Exit;
//Anything below CHR33 and above CHR126 is crap when it comes to internet links.
for i := 1 to Length(S) do
if (Ord(S[i]) < 33) or (Ord(S[i]) > 126) then
System.Exit;
//Ok, first we look at the domain names. Make sure they fit the minimal template.
if ((Pos('www.',LowerCase(S)) = 1) and
(Pos('.', Copy(S, 5, Length(s))) > 0) and
(Length(S) > 7)) or
//A news thing is very similar, so we include it in the OR statement.
((Pos('news:', LowerCase(S)) = 1) and
(Length(S) > 7) and
(Pos('.', Copy(S, 5, Length(S))) > 0))
then
begin
//Naturally, if all goes well and the test is passed, we end
//the seek right there.
Result := True;
System.Exit;
end
//This is the mail section - and it will recognize any email addresses found.
else if ((Pos('mailto:', LowerCase(S)) = 1) and (Length(S) > 12) and
(Pos('@', S) > 8) and (Pos('.', S) > 10) and
(Pos('.', S) > (Pos('@', S) +1))) or
((Length(S) > 6) and (Pos('@', S) > 1) and (Pos('.', S) > 4) and
(Pos('.', S) > (Pos('@', S) +1)))
then
begin
Result := True;
System.Exit;
end
//An extention of all www. stuff is here with the browser headers included.
else if ((Pos('http://', LowerCase(S)) = 1) and
(Length(S) > 10) and
(Pos('.', S) > 8)) or
((Pos('ftp://', LowerCase(S)) = 1) and
(Length(S) > 9) and (Pos('.', S) > 7))
then
begin
Result := True;
System.Exit;
end
else
begin
// So we have passed all of the word types. Now its time to see
// if the thing contains numbers in such format as a numeric ip would be.
Result := True;
for Count := 1 to 4 do
begin
p := Pos('.',S) - 1;
if p < 0 then
p := Length(S);
Val(Copy(S, 1, p), x, c);
if ((c <> 0) or (x < 0) or (x > 255) or (p>3)) then
begin
Result := False;
Break;
end;
Delete(S, 1, p + 1);
end;
if (S <> '') then
Result := False;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if not IsURL(Edit1.Text) then
Showmessage('유효하지 않은 URL 입니다');
(* Checking URL Sample
1. www.leapware.com
2. http://www.leapware.com
3. nwillams@telusplanet.net
4. mailto:nwillams@telusplanet.net
3. news:alt.why.do.i.bother
4. ftp:://ftp.microsoft.com
5. 192.168.0.1
*)
end;
end.