我在我的android應用程序中有一個TextView。現在我需要從ashx頁面獲得一個值。當我在瀏覽器中打開該ashx頁面時,我可以看到它只顯示一個值。我需要在我的TextView中顯示這個值。如何從ashx頁面獲取android中的字符串值?
請幫我...
我在我的android應用程序中有一個TextView。現在我需要從ashx頁面獲得一個值。當我在瀏覽器中打開該ashx頁面時,我可以看到它只顯示一個值。我需要在我的TextView中顯示這個值。如何從ashx頁面獲取android中的字符串值?
請幫我...
獲取Internet權限....和公正運行這段代碼...
try
{
HttpClient client=new DefaultHttpClient();
HttpGet request=new HttpGet("http://173.45.66.154/VSServices/Export.ashx?f=GetClientBalance&pin=rsbtest&includeCurrency=true");
HttpResponse response=client.execute(request);
HttpEntity entity=response.getEntity();
String resonseText=EntityUtils.toString(entity);
textviewObject.setText(resonseText);
entity.consumeContent();
}
catch(Exception e)
{
e.getStackTrace();
Toast.makeText(MainActivity.this, e.toString() , 0).show();
}
你能告訴我ashx的網頁...與網址.. ..? – 2014-10-20 07:03:53
http://173.45.66.154/VSServices/Export.ashx?f=GetClientBalance&pin=rsbtest&includeCurrency=true – Shoaib 2014-10-20 07:04:16
@AngadTiwari:這是 – Shoaib 2014-10-20 07:05:33