比如有一个网站,数据库是mysqlhttp://www.xxx.com我现在要获取
http://www.xxx.com/test.php?id=2 这个网址的信息这个网址里有5条评论信息姓名 评论的话我要把它们取出来,在经过适当的修改排列,成如图所示的样子,,给个代码吧区域1 为一个按钮,,点击获取http://www.xxx.com/test.php?id=2 这个网址的信息区域2 排版 列出这5条记录,红色区域,左侧箭头显示姓名,右侧箭头显示评论设mysql 表为 info 2个字段name content
姓名 评论
http://www.xxx.com/test.php?id=2 这个网址的信息这个网址里有5条评论信息姓名 评论的话我要把它们取出来,在经过适当的修改排列,成如图所示的样子,,给个代码吧区域1 为一个按钮,,点击获取http://www.xxx.com/test.php?id=2 这个网址的信息区域2 排版 列出这5条记录,红色区域,左侧箭头显示姓名,右侧箭头显示评论设mysql 表为 info 2个字段name content
姓名 评论
解决方案 »
- android wifi相关问题
- android 怎么实现列表功能
- 求解:设定默认闹钟铃声需要申明神马权限?
- 请问android开发 如何做软件升级呀?
- 在android中,删除SD卡里的数据后刷新数据的问题
- Android 视频采集的问题
- 求救!android向servlet提交数据,然后提交给jsp,如何在android端显示生成的这个jsp?
- 各位做android的哪方面??上层的还是系统的?
- android SDK manager 安装在eclipse上出现问题
- 高版本的Android sdk编译成的apk怎样在低版本的手机上跑?
- 【70分!急!】代码并未往下执行!
- android项目AsyncTask类方法不执行问题
{
........
return sdata;
}那么我要点击一个按钮,使得传进参数为1,请问怎么写代码
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace test
{
/// <summary>
/// Service1 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[SoapRpcService]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.Script.Services.ScriptService]
public class hello : System.Web.Services.WebService
{ [SoapRpcMethod, WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}package org.stu;import java.io.IOException;import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
public class StuActivity extends Activity
{
String nameSpace = "http://tempuri.org/";
String methodName = "HelloWorld";
String url = "http://www.stu80.com/hello.asmx";
private EditText txt1;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txt1 = (EditText) findViewById(R.id.txt1);
// 调用的方法
String methodName = "HelloWorld";
// 创建HttpTransportSE传输对象
HttpTransportSE ht = new HttpTransportSE(url);
ht.debug = true;
// 使用SOAP1.1协议创建Envelop对象
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11 );
// 实例化SoapObject对象
SoapObject soapObject = new SoapObject(nameSpace, methodName);
// soapObject.addProperty("param", "1");
// 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息
envelope.bodyOut = soapObject;
try
{
// 调用Web Service
ht.call(null, envelope);
if (envelope.getResponse() != null)
{
// 获取服务器响应返回的SOAP消息
SoapObject result = (SoapObject) envelope.bodyIn;
txt1.setText(result.toString());
}
}
catch (IOException e)
{
e.printStackTrace();
}
catch (XmlPullParserException e)
{
e.printStackTrace();
}
}
}
运行报错误,,请问怎么做,,这次代码非常清晰了,,错误是虚拟机里 stopped的那个错误,force close
socket编程求帮助:http://topic.csdn.net/u/20120514/01/e822cd39-6820-412c-a203-79cf9167a9f6.html