게시판 본문 COM / COM+ by VB 6.0 - Read Only
뉴스그룹에서 재미난 방법을 찾았습니다. |
---|
작성자: zziuni
작성일시: 2004-10-20 13:32,
조회수: 6,214
|
답변글을 올리고 돌아다니다가... 뉴스그룹에서 재미난걸 찾았습니다.
DLL제작없이 Form전송이 되더군요. XMLHTTP를 사용한 샘플 소스를 찾았습니다. ^^ XMLHTTP는 Open만 항상 사용을 해서.. Send는 전혀 생각못했습니다. 게다가 Form전송이라는것이 HTTPHearder로 표현되는거라는것도 새롭게 알았습니다. 재미있어 보여서 올립니다. ^^ <% set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP") '-- image 파일오픈 --------------------------------------------- arg_datafile = "c:\00832_001_4.sis" set stream = Server.CreateObject("ADODB.Stream") stream.Type = 1 stream.Open() stream.LoadFromFile(arg_datafile) arg_binary = trim(getString(stream.Read)) stream.Close() Function getString(byVal StringBin) dim intCount getString ="" For intCount = 1 to LenB(StringBin) getString = getString & AscB(MidB(StringBin, intCount, 1)) Next End Function '-- POST 방식 : 테스트 파라메터세팅 ---------------------------- arg_bound ="----------20040129024640189e2500990" arg_usr_id = "insik" arg_origctn = "0101111111" arg_destctn = "0112222222" arg_jumin = "7777777777777" arg_imgformat = "10012" arg_sendmsg = "ccc" arg_charged = "N" arg_cpflag = "ccc" arg_evtcb = "" arg_filename = "E00832_001_4.sis" arg_filetype = "image/sis" arg_host = "1.1.1.1" arg_pgm = "/p/send_notip_010.asp" '-- POST 방식 : Body세팅 -------------------------------------- httpBody = vbCrLf & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""USR_ID""" & vbCrLf & vbCrLf & arg_usr_id & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""jumin""" & vbCrLf & vbCrLf & arg_jumin & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""origCTN""" & vbCrLf & vbCrLf & arg_origctn & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""destCTN""" & vbCrLf & vbCrLf & arg_destctn & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""imgFormat""" & vbCrLf & vbCrLf & arg_imgformat & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""sendMSG""" & vbCrLf & vbCrLf & arg_sendmsg & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""is_charged""" & vbCrLf & vbCrLf & arg_charged & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""cpflag""" & vbCrLf & vbCrLf & arg_cpflag & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""evtcb""" & vbCrLf & vbCrLf & arg_evtcb & vbCrLf & "--" & arg_bound & vbCrLf httpBody = httpBody & "content-disposition: form-data; name=""imgFile""; filename=""" & arg_filename & """" & vbCrLf httpBody = httpBody & "Content-Type: " & arg_filetype & vbCrLf & vbCrLf httpBody = httpBody & arg_binary httpBody = httpBody & vbCrLf & "--" & arg_bound & "--" & vbCrLf '-- POST 방식 :Open ----------------------------------------- objXMLHTTP.Open "POST", "http://" & arg_host & arg_pgm , false '-- POST 방식 : Header세팅 ---------------------------------- objXMLHTTP.SetRequestHeader "Content-type", "multipart/form-data, boundary=" & arg_bound objXMLHTTP.SetRequestHeader "Content-length", Len(httpBody) '-- POST 방식 :전송 ----------------------------------------- objXMLHTTP.Send httpBody Response.Write "<BR><BR>Post Method Result=" & objXMLHTTP.ResponseText & "<BR>" Response.Write replace (httpBody, vbCrLf, "<BR>") 'Response.Write httpBody %> |
IP 주소: 211.192.244.92
|
전체 1 건의 댓글이 존재합니다.
송원석 |
멋지네요. XMLHTTP 개체를 통해서 HTTP 메세지를 보낼 수가 있었군요. 좋은 정보에 감사드립니다. ^_^
|
2004-10-20 15:28 |
전체 276 건의 게시물,
12 페이지로 구성된
COM / COM+ by VB 6.0 게시판의
10 페이지입니다.
게시물 | ||||
---|---|---|---|---|
2004-10-20 | 6,214 | |||
50 | 2004-08-21 | 3,193 | ||
49 | 2004-08-21 | 3,181 | ||
48 | 2004-08-17 | 8,603 | ||
47 | 2004-08-18 | 3,708 | ||
46 |
해결방법 [1] |
홍완식 |
2004-08-19 | 834 |
45 | 2004-07-29 | 3,094 | ||
44 | 2004-07-29 | 2,913 | ||
43 | 2004-05-21 | 3,730 | ||
42 | 2004-05-22 | 3,110 | ||
41 | 2004-05-22 | 2,933 | ||
40 |
우기 |
2004-05-08 | 776 | |
39 | 2004-05-08 | 3,192 | ||
38 |
우기 |
2004-05-08 | 769 | |
37 | 2004-05-08 | 3,236 | ||
36 |
우기 |
2004-05-08 | 784 | |
35 |
윤경민 |
2004-02-26 | 785 | |
34 | 2004-02-26 | 3,210 | ||
33 |
궁금이 |
2004-02-01 | 982 | |
32 | 2004-02-02 | 3,266 | ||
31 |
궁금이 |
2004-02-02 | 919 | |
30 | 2004-02-02 | 3,082 | ||
29 | 2003-11-03 | 3,479 | ||
28 | 2003-11-03 | 3,495 | ||
27 | 2003-11-04 | 3,425 |