<%!
Private string getyichaadresult (string UA, string URL, string US1, string us2, string uid, string IP ){
Stringbuffer ADDR = new stringbuffer ();
ADDR. append ("http: // ### host ###/ad2/ad2/Qt. jsp? Adpid = 2 & Atype = T & OP = H & mode = S & SID = ### Sid ###& num ### num #### & ENC = ## # ENC ###& fm = C & CL = J & C1 #### C1 ###& C2 ### C2 ###& C3 ### C3 ###& T1 ### T1 ###& T2 ### T2 ###& T3 ### T3 #### & Cols ### Cols ###& IMG ### IMG ####& S1 ### S1 ###& S2 ### S2 #### & retname ### retname ###& returl ###");
Stringbuffer sb = new stringbuffer ();
Java. Io. bufferedreader reader = NULL;
Try {
ADDR. append ("& UA =" + java.net. urlencoder. encode (UA, "### ENC ###"));
ADDR. append ("& url =" + java.net. urlencoder. encode (URL, "### ENC ###"));
ADDR. append ("& guid = on & uid =" + java.net. urlencoder. encode (UID, "### ENC ###"));
ADDR. append ("& IP =" + java.net. urlencoder. encode (IP, "### ENC ###"));
Java.net. urlconnection conn = (New java.net. URL (ADDR. tostring (). openconnection ();
If (US1! = NULL)
Conn. setrequestproperty ("X-jphone-UID", US1 );
If (us2! = NULL)
Conn. setrequestproperty ("X-Up-subno", us2 );
Reader = new java. Io. bufferedreader (New java. Io. inputstreamreader (conn. getinputstream (), "### ENC ###"));
For (string line; (line = reader. Readline ())! = Null {
SB. append (line );
}
}
Catch (Java. Io. ioexception IOE ){
IOE. printstacktrace ();
}
Finally {
Try {
If (reader! = NULL)
Reader. Close ();
}
Catch (Java. Io. ioexception ioe0 ){
Ioe0.printstacktrace ();
}
}
Return sb. tostring ();
}
%> <%
String S0 = request. getheader ("User-Agent ");
String S1 = request. getrequesturl (). tostring ();
String S2 = request. getheader ("X-jphone-UID ");
String S3 = request. getheader ("X-Up-subno ");
S1 + = (request. getquerystring ()! = NULL )? "? "+ Request. getquerystring (). tostring ():"";
// Ip
String IP = request. getremotehost ();
IP = NULL? "": IP address;
// Uid
String uid = "0 ";
String useragent = request. getheader ("User-Agent ");
If (useragent! = NULL ){
Useragent = useragent. touppercase ();
// KDDI
If (useragent. indexof ("KDDI")>-1 ){
Uid = request. getheader ("X-Up-subno ");
Uid = NULL? "0": uid;
// Softbank
} Else if (useragent. indexof ("Vodafone")>-1
| Useragent. indexof ("J-PHONE")>-1
| Useragent. indexof ("Softbank")>-1
| Useragent. indexof ("mot")>-1 ){
Uid = request. getheader ("X-jphone-UID ");
Uid = NULL? "0": uid;
} Else if (useragent. indexof ("DoCoMo")>-1 ){
Uid = request. getheader ("X-DCMGUID ");
Uid = NULL? "0": uid;
} Else {// other
Uid = "0 ";
}
}
Out. Print (getyichaadresult (S0, S1, S2, S3, uid, ip ));
%>