-1

stackoverflowのすべてのメンバーにハロー。

Android開発の初心者ですが、ウェブサイトにデータを投稿する方法やサンプラーを教えてくれる人はいますか?

オンラインクラッカーにハッシュを投稿し、結果を文字列として戻したいです。

edit_box = enter the hash

sendbutton=ハッシュを送信text_view=resuld

http://xdecrypt.com/# ありがとう

編集:@ライブヘッダーを見て、この結果を見つけました http://xdecrypt.com/ajax/liste.php?hash=759fdfa1a99563aa6309bb6ae27537c564547f62

ここで、ハッシュをURLに追加でき、結果はです。

document.getElementById('hashresult').value="";document.getElementById('hashresult').value+="759fdfa1a99563aa6309bb6ae27537c564547f62(MySQL)=amande1975 ";

今、私はこれを誰もが助けることができる文字列として読みたいですか?

ハッシュタイプMySQLとパスワードamande1975を表示したい。そして、UIにtext_viewとして表示します。

再度、感謝します。

編集:2その作品ですが、今文字列を分割する方法は?誰でも助けることができますか?

          try {
            String webPage = "http://xdecrypt.com/ajax/liste.php?hash="+hashedit.getText().toString();
            URL url = new URL(webPage);
            URLConnection urlConnection = url.openConnection();
            InputStream is = urlConnection.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);

            int numCharsRead;
            char[] charArray = new char[1024];
            StringBuffer sb = new StringBuffer();
            while ((numCharsRead = isr.read(charArray)) > 0) {
                sb.append(charArray, 0, numCharsRead);
            }
            String result = sb.toString();

            System.out.println("*** BEGIN ***");
            System.out.println(result);
            System.out.println("*** END ***");

            TextView tv2 = (TextView) findViewById(R.id.textView2);
            tv2.setText("HashResuld="+sb.toString());

EDIT3:その作品;)

助けてくれてありがとう;)

4

1 に答える 1

0

以前にかなりの調査を行ったことがあります.ksoap2にはWebサービスのURLでデータ転送を行う機能があり、使用できる他のhttp機能があると思います.

http://ksoap2.sourceforge.net/

ksoap2 をダウンロードしてプロジェクトにインポートし、サービス アクセス レイヤーを次のように作成します。

import java.util.ArrayList;
import java.util.List;

import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;

import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.ksoap2.SoapEnvelope;


public class ServiceAccess {

private static String Namespace;
private static String MethodName;
private static String URL;
private SoapSerializationEnvelope Envelope;
private SoapObject SoapRequest;
private SoapPrimitive Response;
private List<PropertyInfo> methodParamList; 

public ServiceAccess(String webserviceUrl, String methodName) throws Exception
{
    setUrl(webserviceUrl);
    setMethodName(methodName);
    setNamespace("http://tempuri.org/");
    SoapRequest = new SoapObject(this.getNamespace(), this.getMethodName());
    methodParamList = new ArrayList<PropertyInfo>();
}
protected String getUrl()
{
    return URL;
}
protected void setUrl(String url)
{
    URL = url;
}
protected String getMethodName()
{
    return MethodName;
}
protected void setMethodName(String methodName)
{
    MethodName = methodName;
}
protected String getNamespace()
{
    return Namespace;
}
protected void setNamespace(String namespace)
{
    Namespace = namespace;
}
protected String SoapAction()
{
    String SOAP_ACTION = this.getNamespace() + this.getMethodName();
    return SOAP_ACTION;
}
protected void CreateSoapRequest() throws Exception
{
    try
    {
        if(methodParamList.size()>0){
            for(PropertyInfo propInfo : methodParamList)
            {
        SoapRequest.addProperty(propInfo.getName(), propInfo.getValue());
            }
        }
    }catch(Exception ex){
        throw ex;
    }

}
public <T> void addMethodParameters(String paramName, T val)
{
    PropertyInfo prop = new PropertyInfo();
    prop.setName(paramName);
    prop.setValue(val);
    prop.setType(val.getClass());
    methodParamList.add(prop);
}
protected SoapSerializationEnvelope createEnvelope() throws Exception
{
    this.CreateSoapRequest();
    try{

        Envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        Envelope.dotNet = true;
        Envelope.setOutputSoapObject(SoapRequest);

    }catch(Exception ex){
        throw ex;
    }
    return Envelope;
}
public String getResponse() throws Exception
{
    try{

        this.createEnvelope();

        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

           androidHttpTransport.call(this.SoapAction(), Envelope);

           Response = (SoapPrimitive) Envelope.getResponse();

    }catch(Exception ex){
        throw ex;
    }
    return Response.toString();
}

}

Web サービスの URL の代わりに Web ページのさまざまな URL を使用するように微調整できます。

于 2012-06-06T01:08:41.517 に答える