Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

j2meѧϰ J2me Wap Explorer


package org.fox.image;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Image;
/**
* ÀàÃû£ºImageHandler.java ±àдÈÕÆÚ: 2007-8-17
³ÌÐò¹¦ÄÜÃèÊö£º
Demo:
*
Bug:
*
* ³ÌÐò±ä¸üÈÕÆÚ £º
±ä¸ü×÷Õß £º
±ä¸ü˵Ã÷ £º
*
* @author wuhua rrq12345@163.com
*/
public class ImageHandler implements Runnable {
private HttpConnection c = null;
private InputStream is = null;
private ByteArrayOutputStream baos = new ByteArrayOutputStream();
private Image image = null;
private String iamgeUrl;
private ImageCanvas imageCanvas;
private ImagePart imagePart;
private ImageHandler(String imageUrl,ImagePart imagePart,ImageCanvas imageCanvas){
this.iamgeUrl = imageUrl;
this.imagePart = (ImagePart)imagePart;
this.imageCanvas = imageCanvas;
new Thread(this).start();
}
public static ImageHandler getIamgeHandler(String imageUrl,
ImagePart imagePart,ImageCanvas imageCanvas){
return new ImageHandler(imageUrl,imagePart,imageCanvas);
}
/* »ñµÃÍøÂçͼƬ */
public Image handlerIamge() throws Exception{
byte[] imageData = null;
try {
c = (HttpConnection) Connector.open(iamgeUrl);
is = c.openInputStream();
int ch = 0;
while ((ch = is.read()) != -1) {
baos.write(ch); // ¶ÁÈ¡ÍøÂçͼƬ
}
} catch (IOException ioe) {
throw new IOException("Connect Error");
}
imageData = baos.toByteArray(); // °ÑͼƬת»»³É×Ö½Ú
try {
image = Image.createImage(imageData, 0, imageData.length);
} catch (NullPointerException e) {
throw new NullPointerException("NullPointerException");
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("IllegalArgumentException");
}
return image;
}
public void run() {
try {
imagePart.setImage(handlerIamge());
imageCanvas.repaint();
} catch (Exception e) {
e.printStackTrace();
}
}
}


Ïà¹ØÎĵµ£º

wapÁ÷Á¿Í³¼Æ´úÂ룺¹ØÓÚ»ñÈ¡·þÎñÆ÷»·¾³±äÁ¿µÄ·½·¨


×î½üÔÚдһ¸öwapÁ÷Á¿Í³¼ÆµÄ¹¤¾ß£¬ÓÚÊǾÍÈ¥ÕÒ¹ØÓÚwapÁ÷Á¿Í³¼ÆµÄÏà¹ØÍøÕ¾»òÂÛ̳¡£
Ç°Á½ÌìÕÒµ½1¸öËû¾ËÍø£¬×¨ÃÅ×öwapÍøÕ¾Á÷Á¿Í³¼ÆµÄ£¬ÓÚÊÇÈ¥ÆäÂÛ̳Öп´ÁË¿´Ð©¼¼ÊõÎÄÕ£¬¸Ð¾õ»¹¿ÉÒÔ¡£Ó¦¸ÃÊÇгöÏֵģ¬ÒÔǰûÓз¢ÏÖ¡£
ÆäÖÐÓÐƪÎÄÕºܼòµ¥£¬ÊÇasp.netµÄ»ñÈ¡·þÎñÆ÷»·¾³±äÁ¿·½·¨£º
public string GetServerVariables()
{
&nbs ......

WapÁ÷Á¿Í³¼Æ¿ª·¢ÖÐʹÓÃCacheÐĵÃ

ÔÚ¡¶Ëû¾ËÍøwapÁ÷Á¿Í³¼Æ·ÖÎöƽ̨¡·¿ª·¢ÖÐΪÁËÌá¸ßϵͳµÄÐÔÄÜ£¬ÎÒÃÇÀûÓÃCacheÀ´±£´æÊý¾Ý£¬ÀýÈç°ÑÓû§µÄһЩȨÏÞÐÅÏ¢·ÅÔÚCacheÖУ¬µ«ÕâÑù×ö»áÓÐ
ЩÎÊÌ⣬ºÎʱÇå³ýCacheÓëÊý¾Ý±£³Öͬ²½£¬ÏÂÃæÎÒÔÚÏîÄ¿ÖÐʹÓÃCacheµÄÐĵã¬Óë´ó¼Ò·ÖÏí¡£
Ò»¡¢ÀûÓÃCacheDependency
Àà
¡¡¡¡ËüÔÚÃüÃû¿Õ¼äSystem.Web.CachingÖС£CacheDependencyÀà» ......

ÓÃVS2005¿ª·¢WAPÍøÕ¾³õʶ

1."Îļþ"->"н¨ÍøÕ¾"->"ASP.NETÍøÕ¾"н¨Õ¾µã¡£
2.ɾ³ý"Default.aspx"Îļþ£¬"Ìí¼ÓÐÂÏî"->"Òƶ¯Web´°Ìå"¡£
3."Ìí¼ÓÐÂÏî"->"Òƶ¯WebÅäÖÃÎļþ"¡£
4.ÔÚweb.configµÄ<system.web>ÖÐÌí¼Ó
Ç¿ÖÆÊä³öwml
<browserCaps>
            <res ......

WAPÊÖ»úÏÂÔØ·þÎñÁ÷³ÌͼÊÍ˵Ã÷

ͼ1-ÏÂÔØ·þÎñϵͳµÄÂß¼­½á¹¹
    ÄÚÈÝ·þÎñÆ÷ÊÇΪÒƶ¯Óû§ÌṩMIMEÄÚÈݵÄʵÌå¡£ÏÂÔØ·þÎñÆ÷½ÓÊÕÀ´×ÔÖն˵ÄÏÂÔØÇëÇ󣬲¢¹ÜÀí´ÓÄÚÈÝ·þÎñÆ÷µ½ÖÕ¶Ëä¯ÀÀÆ÷ÄÚÈݵĴ«µÝ¡£ ÄÚÈÝ·þÎñÆ÷ʹÓÃWAP PushÒµÎñ×°È루Service Loading£©´¥·¢ÄÚÈÝÏÂÔØ¡£ÏÂÔØ·þÎñÆ÷¿ÉÒÔÌṩµÄ¹¦ÄÜÈçÏ£º
    É豸´æ´¢ÄÜÁ¦¹ÜÀí
&n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ