锘??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-澧欏鑽夌殑Javahttp://www.67529968.com/javagrass/zh-cnMon, 25 Feb 2019 15:19:41 GMTMon, 25 Feb 2019 15:19:41 GMT602013骞?鏈?2鏃?涓狢#鏈鐑棬闂?#26864;?#29785;瓟http://www.67529968.com/javagrass/archive/2013/08/12/402683.html澧欏鑽?/dc:creator>澧欏鑽?/author>Mon, 12 Aug 2013 02:53:00 GMThttp://www.67529968.com/javagrass/archive/2013/08/12/402683.htmlhttp://www.67529968.com/javagrass/comments/402683.htmlhttp://www.67529968.com/javagrass/archive/2013/08/12/402683.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/402683.htmlhttp://www.67529968.com/javagrass/services/trackbacks/402683.html闂?C#鎬庝箞璁惧畾Stream.Read?#27537;?#31220;鏃?#37827;?#38338;?/a>
?#29919;:streamReader.BaseStream.ReadTimeout = 2000;

闂?C#濡備綍浠嶺mlNode閲屽垹闄CDATA鏍?#32475;?/a>
?#29919;:
xml.innerText = xml.innerText.Replace("![CDATA[","").Replace("]]","");
xmlDoc.Save();// xmlDoc is your xml document

?#29919;:
var dt = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Math.Round(1372061224000 / 1000d)).ToLocalTime();
Console.WriteLine(dt); // Prints: 6/24/2013 10:07:04 AM

?#29919;:
var attributes = (from n in xml.Root.Attributes("someProperty")
                        select n.Value).ToList();
?#29919;:
Regex regex = new Regex(@"\s{2,}"); // matches at least 2 whitespaces
if (regex.IsMatch(inputString))
    // do something



]]>
javascript?#27537;indexof鏂规硶?#27537;?#30078;涔夊拰鐢硶http://www.67529968.com/javagrass/archive/2013/02/20/395474.html澧欏鑽?/dc:creator>澧欏鑽?/author>Wed, 20 Feb 2013 08:46:00 GMThttp://www.67529968.com/javagrass/archive/2013/02/20/395474.htmlhttp://www.67529968.com/javagrass/comments/395474.htmlhttp://www.67529968.com/javagrass/archive/2013/02/20/395474.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/395474.htmlhttp://www.67529968.com/javagrass/services/trackbacks/395474.html
javascript?#27537;indexof鏂规硶鍙?#26473;?#37733;炴煇涓寚?#30078;?#27537;?#29927;绗?#28051;?#37706;煎湪?#29927;绗?#28051;?#28051;?#26851;栨鍑虹幇?#27537;?#32133;缃?/div>
杩?#37733;?String 瀵硅薄鍐?#32471;?#28051;娆?#37713;虹幇瀛愬瓧绗?#28051;茬殑?#29927;绗綅缃?#37510;?br />strObj.indexOf(subString[, startIndex])
鍙傛暟
strObj
蹇呴夐銆係tring 瀵硅薄鎴?#37826;囧瓧銆?br />subString
蹇呴夐銆傝?#20344;湪 String 瀵硅薄涓煡鎵剧殑瀛愬瓧绗?#28051;?#37510;?br />starIndex
鍙?#38315;夐銆?#29831;?#37825;存暟鍊兼寚鍑哄湪 String 瀵硅薄鍐呭紑濮嬫煡鎵剧殑绱紩銆?#28641;傛?#28357;渷鐣?#38171;屽垯浠庡瓧绗?#28051;茬殑?#32017;濮?#28598;勬煡鎵?#37510;?br />
璇存槑
indexOf 鏂规硶杩?#37733;?#28051;涓?#37825;存暟鍊硷紝?#23514;鍑?String 瀵硅薄鍐呭瓙?#29927;绗?#28051;茬殑?#32017;濮嬩綅缃?#37510;?#28641;傛?#28356;病鏈?#37813;惧埌瀛愬瓧绗?#28051;诧?#23677;垯杩?#37733;?-1銆?br />
濡傛灉 startindex 鏄礋?#26271;锛屽垯 startindex 琚綋浣滈浂銆?#28641;傛灉瀹?#23011;?#37832;澶殑?#29927;绗綅缃?#32497;紩杩?#28598;?#38171;屽?#27407;畠琚綋浣?#37832;澶殑鍙兘绱紩銆?br />
浠庡乏鍚?#37721;?#37813;?#29723;屾煡鎵?#37510;傚惁鍒欙紝璇?#37826;规硶涓?lastIndexOf 鐩?#37722;?#37510;?br />
绀轰緥

涓嬮潰?#27537;绀轰緥璇存?#24221;簡 indexOf 鏂规硶?#27537;鐢硶銆?br />
浠爜濡?#28051;?

function IndexDemo(str2){
var str1 = "BABEBIBOBUBABEBIBOBU"
var s = str1.indexOf(str2);
return(s);
}


lastIndexOf鏂规硶杩?#37733;?#28699;愬瓧绗?#28051;?#37832;鍚?#28051;娆?#37713;虹幇?#27537;?#32133;缃?#38171;屽拰 indexof鐩?#37721;?#37510;?br />
substring鏂规硶

str锛漵tr.substring(int beginIndex);鎴?#37721;栨?#22651;tr浠?#26851;栧瓧姣?#29863;烽暱搴?#28051;beginIndex?#27537;?#29927;绗?#28051;诧?#23677;皢鍓?#28003;欏瓧绗?#28051;?#29863;?#37706;肩粰str锛?br />str锛漵tr.substring(int beginIndex?#32029;int endIndex);鎴?#37721;str涓?#28000;beginIndex?#32017;濮嬭嚦endIndex缁撴潫鏃剁殑?#29927;绗?#28051;诧紝骞跺皢鍏?#29863;?#37706;肩粰str;

?#32229;瀛?#38171;?br />浠爜濡?#28051;?
var elems=node.getElementsByTagName(“*");
for(var i=0;i<elems.length;i++){
if(elems[i].className.indexOf(classname)!=-1)
{ }
}

a.indexOf(b)鍙?#37922;?#37833;?#37714;柇鍖?#38320;嶏紝杩?#37733;b?#28266;a鍑虹幇?#27537;绗?#28051;涓瓧姣嶇殑?#32133;缃紝濡傛?#28356;病鏈?#26473;?#37733;?1銆?br />濡傛灉鏈?#38322;?#28598;嶇殑?#29927;绗?#37713;虹幇?#32029;浠?#32471;?#28051;涓瓧绗?#28051;?#37713;?#37510;?/div>鐩稿叧鍐呭:


澧欏鑽?/a> 2013-02-20 16:46 鍙戣璇?#29825;?/a>
]]>Eclipse閫?#26473;囩?#23384;帴澶?#37714;?#28729;夎鎻?#28000;剁殑鏂规硶http://www.67529968.com/javagrass/archive/2013/02/16/395327.html澧欏鑽?/dc:creator>澧欏鑽?/author>Sat, 16 Feb 2013 02:52:00 GMThttp://www.67529968.com/javagrass/archive/2013/02/16/395327.htmlhttp://www.67529968.com/javagrass/comments/395327.htmlhttp://www.67529968.com/javagrass/archive/2013/02/16/395327.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/395327.htmlhttp://www.67529968.com/javagrass/services/trackbacks/395327.html

鍋?#29825;?#28003;犵殑 Eclipse?#27537;?#28266;锛圕:\eclipse), 瑙帇浣?#28051;?#26462;界殑 eclipse 鎻?#28000;舵?#26668;呭?#22798;?#21328;clipse 鎻?#28000;?#37714;版寚?#30078;鐩綍AA(c:\AA)鏂?#28000;?#28598;癸紝鎵撳紑AA 鏂?#28000;?#28598;?#38171;屽湪AA鏂?#28000;?#28598;?#38322;屽垎鍒?#37718;呭惈涓?#28051;?#37826;?#28000;?#28598;筬eatures?#25328;plugins ?#32029;?#21159;鍚?#37814;?#28051;?#28051;?#37826;?#28000;?#28598;?#38322;岀殑鏂?#28000;?#37714;?#37714;?#28598;?#37714;?#37714;癳clipse涓?#37813;瀵?#25652;殑鏂?#28000;?#28598;?#28051;嬬殑features ?#25328;plugins 涓嬶紝涓鑸殑鎶婃彃浠舵枃浠?#37929;存帴澶?#37714;? 鍒癳clipse鐩綍閲?#37828;?#37832;鐩存帴涔?#37828;?#37832;鎰氳牏?#27537;涓绉?#37826;规硶锛?#37733;?#28051;?#37827;?#37722;庢?#23456;?#20344;垹闄?#26473;欎簺鎻?#28000;?#28028;氶潪甯哥殑鍥伴毦锛?#23534;?#37714;楃殑涓?#37818;?#38013;?#28003;?#37922;?#38171;?#38171;?#38171;?/span>

娉?#37808;?#38171;氱?#23384;帴?#30370; 鎻?#28000;?#37718;?#29785;帇鍒plugins鏂?#28000;?#28598;?#28051;?#28052;嬪悗?#32029;閲?#37722;痚clipse锛屽彲?#20824;涓?#28028;氬姞杞?#37826;扮殑鎻?#28000;?#37510;?/span> 

瑙?#37712;?#37826;规硶鏄?#38171;?/span> 

1銆?#37813;撳紑鍛?#28000;?#29723;?#38171;屽?#26495;綋鍓峞clipse?#27537;鐩綍涓嬶紝?#32237;鍏eclipse -clean?#32029;閲?#37826;板惎鍔eclipse?#32029;杩?#37837;積clipse灏?#28028;氬姞涓婃?#25198;殑鎻?#28000;朵簡銆?/span>

2銆?#28641;傛?#28356;彃浠?#28051;嶈兘?#23820;鏁?#38171;屽垯璇峰皢eclipse\configuration\org.eclipse.update鐩綍?#22457;闄?#37722;?#37712;?#37722;?#37716;eclipse:)

浣?#37721;?#28000;湪eclipse?#27537;滃崟"Help"-->"About Eclipse SDK"-->"Feature Details" ?#25328;"Plug-in Details"涓湅鍒?#37826;?#28729;夎?#21615;殑鎻?#28000;?#37510;?/span>

鍋?#29825;?#28003;犵殑Eclipse?#27537;?#28266;锛圕:\eclipse), 瑙帇浣?#28051;?#26462;界殑 eclipse 鎻?#28000;舵?#26668;呭?#22798;?#21328;clipse
鎻?#28000;?#37714;版寚?#30078;鐩綍AA(c:\AA)鏂?#28000;?#28598;癸紝鎵撳紑AA 鏂?#28000;?#28598;?#38171;屽湪AA鏂?#28000;?#28598;?#38322;屽垎鍒?#37718;呭惈涓?#28051;?#37826;?#28000;?#28598;筬eatures?#25328;plugins
?#32029;?#21159;鍚?#37814;?#28051;?#28051;?#37826;?#28000;?#28598;?#38322;岀殑鏂?#28000;?#37714;?#37714;?#28598;?#37714;?#37714;癳clipse涓?#37813;瀵?#25652;殑鏂?#28000;?#28598;?#28051;嬬殑features ?#25328;plugins 涓嬶紝涓鑸殑鎶婃彃浠舵枃浠?#37929;存帴澶?#37714;?
鍒癳clipse鐩綍閲?#37828;?#37832;鐩存帴涔?#37828;?#37832;鎰氳牏?#27537;涓绉?#37826;规硶锛?#37733;?#28051;?#37827;?#37722;庢?#23456;?#20344;垹闄?#26473;欎簺鎻?#28000;?#28028;氶潪甯哥殑鍥伴毦锛?#23534;?#37714;楃殑涓?#37818;?#38013;?#28003;?#37922;?#38171;?#38171;?/span>

娉?#37808;?#38171;氱?#23384;帴?#30370; 鎻?#28000;?#37718;?#29785;帇鍒plugins鏂?#28000;?#28598;?#28051;?#28052;嬪悗?#32029;閲?#37722;痚clipse锛屽彲?#20824;涓?#28028;氬姞杞?#37826;扮殑鎻?#28000;?#37510;?/span>

瑙?#37712;?#37826;规硶鏄?#38171;?/span>

1銆?#37813;撳紑鍛?#28000;?#29723;?#38171;屽?#26495;綋鍓峞clipse?#27537;鐩綍涓嬶紝?#32237;鍏eclipse -clean?#32029;閲?#37826;板惎鍔eclipse?#32029;杩?#37837;積clipse灏?#28028;氬姞涓婃?#25198;殑鎻?#28000;朵簡銆?/span>

2銆?#28641;傛?#28356;彃浠?#28051;嶈兘?#23820;鏁?#38171;屽垯璇峰皢eclipse\configuration\org.eclipse.update鐩綍?#22457;闄?#37722;?#37712;?#37722;?#37716;eclipse:)

浣?#37721;?#28000;湪eclipse?#27537;滃崟"Help"-->"About Eclipse SDK"-->"Feature Details"
?#25328;"Plug-in Details"涓湅鍒?#37826;?#28729;夎?#21615;殑鎻?#28000;?#37510;?/span>

Eclipse鐩稿叧鍐呭:


澧欏鑽?/a> 2013-02-16 10:52 鍙戣璇?#29825;?/a>
]]>
eclipse浣?#37922;link鏂?#28000;?#28729;夎鎻?#28000;剁殑鏂规硶http://www.67529968.com/javagrass/archive/2013/02/16/395326.html澧欏鑽?/dc:creator>澧欏鑽?/author>Sat, 16 Feb 2013 02:51:00 GMThttp://www.67529968.com/javagrass/archive/2013/02/16/395326.htmlhttp://www.67529968.com/javagrass/comments/395326.htmlhttp://www.67529968.com/javagrass/archive/2013/02/16/395326.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/395326.htmlhttp://www.67529968.com/javagrass/services/trackbacks/395326.html

a.鍋?#29825;?#28003;犵殑Eclipse?#27537;?#28266;锛圕:\eclipse),?#28266;璇?#37826;?#28000;?#28598;?#28051;嬶紝鏂板缓杩?#37837;风殑鐩綍缁?#37835;?#38171;圕:\eclipse\PluginsEclipse\jode\eclipse),

b.瑙帇浣?#28051;?#26462;界殑eclipse 鎻?#28000;舵?#26668;呭?#22798;?#21328;clipse 鎻?#28000;?#37714;版寚?#30078;鐩綍BB锛圕:\BB锛?#37826;?#28000;?#28598;癸紝鎵撳紑BB 鏂?#28000;?#28598;癸紝?#21159;鍚?#37814;?
BB鏂?#28000;?#28598;?#38322;岀殑涓?#28051;?#37826;?#28000;?#28598;筬eatures?#25328;plugins 澶?#37714;?#37714;?#37714;?#37714;?#37826;板?#21700;?#30028;殑eclipse
锛圕:\eclipse\PluginsEclipse\jode\eclipse,杩?#37837;積clipse涓?#28751;?#37832;変簡浜?#28051;?#37819;?#28000;?#37929;綍features and
plugins)涓?

c.?#28266; eclipse锛圕:\eclipse)鐩綍涓?#37826;板?#31746;inks(C:\eclipse\links)鐩綍,?#28266;links鐩綍涓?#23524;虹涓涓?#28000;link涓烘墿灞?#37722;??#27537;鏂?#37832;?#37826;?#28000;?#28641;jode.link锛屽?#21613;濡?#28051;媝ath=C:/eclipse/PluginsEclipse/jode
鎴栬?path=C:\\eclipse\\PluginsEclipse\\jode 鎻?#28000;剁殑鐩綍锛?/span>

閲?#37722;痚clipse鎻?#28000;跺氨浼?#28729;夎?#21613;鎴?#37510;?/span>

娉?#37808;?#38171;歭ink鏂?#28000;?#28051;璸ath=鎻?#28000;?#37929;綍?#27537;path璺緞鍒嗛殧瑕?#37922;\\鎴?#37828;?

鍙?#28000;湪eclipse?#27537;滃崟"Help"-->"About Eclipse SDK"-->"Feature Details" ?#25328;"Plug-in
Details"涓湅鍒?#37826;?#28729;夎?#21615;殑鎻?#28000;?/span>


Eclipse鐩稿叧鍐呭:




澧欏鑽?/a> 2013-02-16 10:51 鍙戣璇?#29825;?/a>
]]>Android瀹炵幇鎵?#37832;哄拰鐢?#38004;?#38338;殑UDP缃?#32513;滈氫俊http://www.67529968.com/javagrass/archive/2013/02/07/395208.html澧欏鑽?/dc:creator>澧欏鑽?/author>Thu, 07 Feb 2013 05:44:00 GMThttp://www.67529968.com/javagrass/archive/2013/02/07/395208.htmlhttp://www.67529968.com/javagrass/comments/395208.htmlhttp://www.67529968.com/javagrass/archive/2013/02/07/395208.html#Feedback4http://www.67529968.com/javagrass/comments/commentRss/395208.htmlhttp://www.67529968.com/javagrass/services/trackbacks/395208.html

鍏?#28000;?#32513;?#28051;?#28051;猆DP鐩稿叧?#27537;?#34987;

DatagramSocket 杩?#28051;?#37828;疷DP濂?#37818;瓧?#32029;涓鑸?#37832;嶅姟鍣?#32468;?#37721;?#28000;?#32513;戝畾涓涓?#37832;?#37832;虹鍙紝鑰屽鎴风鍙?#38315;?#37826;?#37714;?#28051;嶉渶瑕?#37510;?/p>

DatagramPacket 杩?#28051;?#37828;暟鎹?#37814;?#37718;咃紝鏈嶅姟鍣?#32468;?#37929;存帴鎸夌紦瀛?#29831;?#38171;屽鎴风鍒欓渶瑕佹寚?#30078;Ip鍦板潃?#25328;绔?#37721;?/p>

杩?#23046;?#37812;?#28000;?#37707;?#28051;猘ndroid鎵?#37832;虹璺?#37922;?#38004;?#32468;?#38315;氫俊

鐢?#38004;?#32468;?#38171;?/span>
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;


public class UdpRecv {

    public static void main(String[] args) throws Exception{
        
        //缁戝畾鏈?#37832;烘柇?#32017;
        DatagramSocket ds = new DatagramSocket(8080);
        
        byte[] buf = new byte[1024];
        DatagramPacket dp = new DatagramPacket(buf,buf.length);
        
        //鎺?#37824;舵暟鎹?#37718;?br />        ds.receive(dp);
        
        //鍙?#37713;烘暟鎹?#37814;?#37712;呭
        String str = new String(dp.getData(),0,dp.getLength());
        
        System.out.println(str);
        
        //鎵撳嵃鍙?#38315;?#37826;圭殑鍦板潃
        System.out.println("ip:"+dp.getAddress().getHostAddress()+"port:"+dp.getPort());
        
        ds.close();
    }
}
-----------------------------------------------------
android鐩稿叧鍐呭:
-----------------------------------------------------
鎵?#37832;虹锛?/span>
package com.bvin.test.udp;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

import android.app.Activity;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    EditText et ;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
         et =  new EditText(this);
        
        setContentView(et);
        
        WifiManager wMan = (WifiManager)getSystemService(Context.WIFI_SERVICE);
        if(!wMan.isWifiEnabled()){
            wMan.setWifiEnabled(true);
        }
        WifiInfo wifiInfo = wMan.getConnectionInfo();
        Log.e("ip", intToIp(wifiInfo.getIpAddress()));//鏈?#37832;ip锛?#28000;wifi鐜?#28583;?#38171;?br />    }

    //鎶?#38014;峰彇?#27537;鏁?#35120;?#26462;崲鎴愬瓧绗瀷
    private String intToIp(int i) {         
        
        return (i & 0xFF ) + "." +         
      ((i >> 8 ) & 0xFF) + "." +         
      ((i >> 16 ) & 0xFF) + "." +         
      ( i >> 24 & 0xFF) ;   
   }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // TODO Auto-generated method stub
        menu.add("鍙?#38315;?);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // TODO Auto-generated method stub
        if(item.getItemId()==0){
            DatagramSocket ds;
            try {
                //濂?#37818;瓧
                ds = new DatagramSocket();
                //鍙?#38315;?#37712;呭
                String str = et.getText().toString();
                //鏋勫?#28888;暟鎹?#37814;?#38171;?#37712;呭+鍦板潃锛?br />                DatagramPacket dp = new DatagramPacket(str.getBytes(),str.length(),InetAddress.getByName("192.168.0.102"),8080);
                //鎶婃暟鎹?#37814;?#37721;?#38315;?#37713;哄
                ds.send(dp);
                //鍏?#38338;?#28610;?#37818;瓧
                ds.close();
                
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            
        }
        return super.onOptionsItemSelected(item);
        
    }
    
    
}
棣?#37711;?#26473;?#29723;?#37922;?#38004;?#37818;?#37824;剁锛屽湪鎺敹鍒?#37721;?#38315;?#37826;规暟鎹?#28052;嬪?#23941;皢浼?#28051;鐩撮?#35826;銆傝?#37813;?#37832;虹浼?#37832;?#28051;緭鍏?#22935;嗭紝鏈?#28051;?#37721;?#38315;佽?#28355;崟锛屽皢浼?#37814;婅緭鍏?#22935;殑鍐呭缁欏彂閫?#37714;PC绔紝铏界劧UDP涓嶇畻鍙潬?#32029;浣?#37828;湪灞鍩?#32515;?#26473;?#37828;?#37816;?#37721;潬銆?br />


澧欏鑽?/a> 2013-02-07 13:44 鍙戣璇?#29825;?/a>
]]>LINQ缂?#29831;?#37714;癈IL?#27537;鏂规硶http://www.67529968.com/javagrass/archive/2013/02/06/395175.html澧欏鑽?/dc:creator>澧欏鑽?/author>Wed, 06 Feb 2013 06:49:00 GMThttp://www.67529968.com/javagrass/archive/2013/02/06/395175.htmlhttp://www.67529968.com/javagrass/comments/395175.htmlhttp://www.67529968.com/javagrass/archive/2013/02/06/395175.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/395175.htmlhttp://www.67529968.com/javagrass/services/trackbacks/395175.html

Linq鐩稿叧:

Linq鏄?#28000;?#28051;?#37714;?#37826;瑰紡缂?#29831;?#38171;?/div>

  1. 棣?#37711;堬紝LINQ ?#29025;璇?#29723;?#26440;惧紡杞崲涓烘?#35268;硶璋?#37922;?#38171;?/p>

    public static void Main() {     var query = db.Cars.Select<Car, Car>(c => c);     foreach (Car aCar in query)     {          Console.WriteLine(aCar.Name);     } } 
  2. 濡傛灉 db.Cars ?#27537;绫诲瀷鏄?IEnumerable<Car> 锛?#37719;?#28729;冪殑 LINQ锛屽?#30789;薄锛夛紝?#21159;鍚?lambda 琛?#26440;惧紡鍙?#37812;愪簡涓涓?#37719;?#37913;殑鏂规硶锛?/p>

    private Car lambda0(Car c) {     return c; } private Func<Car, Car> CachedAnonymousMethodDelegate1; public static void Main() {     if (CachedAnonymousMethodDelegate1 == null)         CachedAnonymousMethodDelegate1 = new Func<Car, Car>(lambda0);     var query = db.Cars.Select<Car, Car>(CachedAnonymousMethodDelegate1);     foreach // ... } 

    ?#28266;?#24135;瀹?#28051;?#28051;嶈皟鐢?#29831;?#37826;规硶 lambda0 浣?#28051;?#29783;垮枩娆?<Main>b__0 锛堝湪 Main 鏄?#37718;呭惈鏂规硶?#27537;鍚嶇?#24110;級銆傚悓鏍凤紝?#32038;瀛樼殑濮?#37813;?#28729;?#38340;?#28051;婅皟鐢?CS$<>9__CachedAnonymousMethodDelegate1銆?/p>

    濡傛?#28356;姝湪浣?#37922;?SQL LINQ ?#21159;鍚?db.Cars 绫诲?#23338;皢涓?IQueryable<Car>?#32029;姝?#23005;骤鏄潪甯?#28051;?#37722;?#37510;?#37929;?#37721;?#38171;屽畠浼?#37714;?#29723;?#26440;惧紡鐩綍鏍戠殑 lambda 琛?#26440;惧紡锛?/p>

    public static void Main() {     var parameter = Expression.Parameter(typeof(Car), "c");     var lambda = Expression.Lambda<Func<Car, Car>>(parameter, new ParameterExpression[] { parameter }));     var query = db.Cars.Select<Car, Car>(lambda);     foreach // ... } 
  3. ?#28266; foreach 寰?#37916;?#37721;?#37812;?#28051;涓?try/finally 鍧?锛?#26473;?#37828;?#37929;?#37722;岀殑涓?#28051;?#38171;?#38171;?/p>

    IEnumerator<Car> enumerator = null; try {     enumerator = query.GetEnumerator();     Car aCar;     while (enumerator.MoveNext())     {         aCar = enumerator.Current;         Console.WriteLine(aCar.Name);     } } finally {     if (enumerator != null)         ((IDisposable)enumerator).Dispose(); } 
  4. 鏈鍚庯紝杩?#37828;?#28051;?IL 缂?#29831;戦鏈熺殑鏂瑰紡銆備互涓?#37828;?#28051;?IEnumerable<Car>锛?/p>

    // Put db.Cars on the stack L_0016: ldloc.0  L_0017: callvirt instance !0 DatabaseContext::get_Cars()   // “if” starts here L_001c: ldsfld Func<Car, Car> Program::CachedAnonymousMethodDelegate1 L_0021: brtrue.s L_0034 L_0023: ldnull  L_0024: ldftn Car Program::lambda0(Car) L_002a: newobj instance void Func<Car, Car>::.ctor(object, native int) L_002f: stsfld Func<Car, Car> Program::CachedAnonymousMethodDelegate1   // Put the delegate for “c => c” on the stack L_0034: ldsfld Func<Car, Car> Program::CachedAnonymousMethodDelegate1   // Call to Enumerable.Select() L_0039: call IEnumerable<!!1> Enumerable::Select<Car, Car>(IEnumerable<!!0>, Func<!!0, !!1>) L_003e: stloc.1   // “try” block starts here L_003f: ldloc.1  L_0040: callvirt instance IEnumerator<!0> IEnumerable<Car>::GetEnumerator() L_0045: stloc.3   // “while” inside try block starts here L_0046: br.s L_005a L_0048: ldloc.3   // body of while starts here L_0049: callvirt instance !0 IEnumerator<Car>::get_Current() L_004e: stloc.2  L_004f: ldloc.2  L_0050: ldfld string Car::Name L_0055: call void Console::WriteLine(string) L_005a: ldloc.3   // while condition starts here L_005b: callvirt instance bool IEnumerator::MoveNext() L_0060: brtrue.s L_0048  // end of while L_0062: leave.s L_006e   // end of try   // “finally” block starts here L_0064: ldloc.3  L_0065: brfalse.s L_006d L_0067: ldloc.3  L_0068: callvirt instance void IDisposable::Dispose() L_006d: endfinally  

    宸茬紪璇戠殑浠爜?#32029;IQueryable<Car> 鐗?#37832;?#37828;?#37816;夐鏈?#28052;?#37510;?#26473;?#38322;?#37828;?#38322;嶈?#20346;殑?#20788;鍒嗭紝鏈?#37714;?#27996;?#28051;?#26473;?锛?#37832;?#37734;?#37721;?#38322;?#28028;?#37832;?#28051;?#37722;岀殑鍋?#32457;诲?#23677;?#23943;?#25198;幇?#28266;?#32029;浣?#29825;?#37812;?#28000;?#36423;?#37923;殑锛?#38171;?/p>

    // typeof(Car) L_0021: ldtoken Car L_0026: call Type Type::GetTypeFromHandle(RuntimeTypeHandle)   // Expression.Parameter(typeof(Car), "c") L_002b: ldstr "c" L_0030: call ParameterExpression Expression::Parameter(Type, string) L_0035: stloc.3    // Expression.Lambda(...) L_0036: ldloc.3  L_0037: ldc.i4.1           // var paramArray = new ParameterExpression[1] L_0038: newarr ParameterExpression L_003d: stloc.s paramArray L_003f: ldloc.s paramArray L_0041: ldc.i4.0                    // paramArray[0] = parameter; L_0042: ldloc.3  L_0043: stelem.ref  L_0044: ldloc.s paramArray L_0046: call Expression<!!0> Expression::Lambda<Func<Car, Car>>(Expression, ParameterExpression[])   // var query = Queryable.Select(...); L_004b: call IQueryable<!!1> Queryable::Select<Car, Car>(IQueryable<!!0>, Expression<Func<!!0, !!1>>) L_0050: stloc.1  


澧欏鑽?/a> 2013-02-06 14:49 鍙戣璇?#29825;?/a>
]]>springMVC鍚?#37721;扮殑鍊?#37827;犳硶閫?#26473;ModelAndView?#27537;addObject浼?#37714;板墠鍙扮殑瑙?#37712;?#37826;规硶http://www.67529968.com/javagrass/archive/2012/12/17/393107.html澧欏鑽?/dc:creator>澧欏鑽?/author>Mon, 17 Dec 2012 07:41:00 GMThttp://www.67529968.com/javagrass/archive/2012/12/17/393107.htmlhttp://www.67529968.com/javagrass/comments/393107.htmlhttp://www.67529968.com/javagrass/archive/2012/12/17/393107.html#Feedback2http://www.67529968.com/javagrass/comments/commentRss/393107.htmlhttp://www.67529968.com/javagrass/services/trackbacks/393107.html
鎸夌収鏍?#37713;?#37922;硶?#27537;璇?#25652;?#29831;?#37828;病闂?#26864;?
鍐呴儴鍏?#28729;?#37814;妋odel 閫?#26473;request.setAttribute(modelName, modelValue); 鏀惧叆?#27537;
    protected void exposeModelAsRequestAttributes(Map<String, Object> model, HttpServletRequest request) throws Exception {
        for (Map.Entry<String, Object> entry : model.entrySet()) {
            String modelName = entry.getKey();
            Object modelValue = entry.getValue();
            if (modelValue != null) {
                request.setAttribute(modelName, modelValue);
                if (logger.isDebugEnabled()) {
                    logger.debug("Added model object '" + modelName + "' of type [" + modelValue.getClass().getName() +
                            "] to request in view with name '" + getBeanName() + "'");
                }
            }
            else {
                request.removeAttribute(modelName);
                if (logger.isDebugEnabled()) {
                    logger.debug("Removed model object '" + modelName +
                            "' from request in view with name '" + getBeanName() + "'");
                }
            }
        }
    }

涓涓?#37721;兘鏄?#28003;?#28729;炵幇?#31777;HandlerInterceptor骞?#28729;炵幇?#31777;锛?
void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object o, org.springframework.web.servlet.ModelAndView modelAndView) throws java.lang.Exception;

?#28266;姝?#28598;勪慨鏀逛簡modelAndView


澧欏鑽?/a> 2012-12-17 15:41 鍙戣璇?#29825;?/a>
]]>YUI--IE杩?#25652;?#37833;?#28051;嶇?#25780;潫?#27537;闂?#26864;樼殑瑙?#37712;?#37826;规硶http://www.67529968.com/javagrass/archive/2012/12/17/393106.html澧欏鑽?/dc:creator>澧欏鑽?/author>Mon, 17 Dec 2012 07:37:00 GMThttp://www.67529968.com/javagrass/archive/2012/12/17/393106.htmlhttp://www.67529968.com/javagrass/comments/393106.htmlhttp://www.67529968.com/javagrass/archive/2012/12/17/393106.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/393106.htmlhttp://www.67529968.com/javagrass/services/trackbacks/393106.html
浣?#37922;YUI璁?#38338;?#37722;?#37721;帮紝杩?#37733;?#28052;嬪?#24225;皢鎻?#32448;alert鍒板墠鍙帮紝浣?#37828;?#37715;?#37721;?a href="http://www.itstrike.cn/Tag/ee5a05fe-c555-4d65-abf8-3f7329749dca">IE椤甸潰?#27537;杩?#25652;?#28051;嶇?#25780;潫銆?
    var callback={
    upload:function(res) {
                var tax = [];
                tax = YAHOO.lang.JSON.parse(res.responseText);
                if(tax.data[0].checkResult=="1") {
                      progressBar.hide();
                errorMessage('******');
                }
            }
    }
    YAHOO.util.Connect.setForm("fm",true);
    var url = contextRootPath+"/policyImport/policyImportEdit.do";
    var transaction = YAHOO.util.Connect.asyncRequest('POST',url, callback,null);
浣?#37828;?#28641;傛灉?#28266;杩?#37733;炵殑缁?#37835;?#28051;?#28003;?#37922;window.location.href璺?#26462;綋鍓?#26916;甸潰锛屽強鍙?#28000;?#29785;?#37712;I紝浣?#37828;?#37812;?#28051;嶆兂閲?#37826;?#29882;?#26462;紝璇?#38338;?#37832;夊浠?#29785;?#37712;?#37826;规鍚?#38171;?

鍥炵瓟:
if(tax.data[0].checkResult=="1") { 
                  progressBar.hide(); 
            errorMessage('******'); 

姝?#28598;?#28051;嶇鏈夋病鏈?缁?#37835;?#26473;?#37733;??#20824;搴?#29831;?progressBar.hide();  鍚?/div>

澧欏鑽?/a> 2012-12-17 15:37 鍙戣璇?#29825;?/a>
]]>jquery瀹炵幇鍥剧墖棰?#29785;殑鏂规硶http://www.67529968.com/javagrass/archive/2012/12/10/392711.html澧欏鑽?/dc:creator>澧欏鑽?/author>Mon, 10 Dec 2012 02:45:00 GMThttp://www.67529968.com/javagrass/archive/2012/12/10/392711.htmlhttp://www.67529968.com/javagrass/comments/392711.htmlhttp://www.67529968.com/javagrass/archive/2012/12/10/392711.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/392711.htmlhttp://www.67529968.com/javagrass/services/trackbacks/392711.html//jquery瀹炵幇鍥剧墖棰?#29785;殑鏂规硶瀹炰緥
function viewimg(index) {
var name = 'uploadimg' + index;
var imgup = $(name);
var imgpath = getpath(imgup);
var local = imgup.value;
var point = local.lastindexof(".");
//鍒柇涓?#28028;?#37826;?#28000;?#28598;?#28751;?
var img = document.createelement("img");
img.src = local;
var filesize = img.filesize;
img.onload = function(){filesize=this.filesize;}
if(img.filesize>5242880){
alert("鍥剧墖鏂?#28000;?#26473;?#28598;?#38171;?);
return false;
}
//鍒柇鏄惁鏄?#37733;剧墖鏍煎紡
var imgname = imgup.value.substring(imgup.value.lastindexof("."), imgup.value.length);
imgname = imgname.tolowercase();
if ((imgname != ".jpg") && (imgname != ".gif") && (imgname != ".jpeg") && (imgname != ".png") && (imgname != ".bmp")) {
alert("u8bf7u9009u62e9u56feu7247u6587u4ef6uff0cu8c22u8c22!");
imgup.focus();
//娓?#32460;file閲岄潰?#27537;鍊紈ww.3ppt.com
imgup.select();
document.selection.clear();
} else {
//鏄剧鍥剧墖
document.getelementbyid("sig_preview"+index).innerhtml = "<img src='" + imgpath + "' border=0 width=200 height=150><img src='images/u51.png' width='16' height='14' onclick='delimage(" + index + ");' />";
}
if (index >=3){
var cnt = index + 1;
$("img" + cnt).style.display = "";
}
}


澧欏鑽?/a> 2012-12-10 10:45 鍙戣璇?#29825;?/a>
]]>缂?#37712;jquery鎻?#28000;剁殑甯?#37922;?#28000;爜鏍煎紡http://www.67529968.com/javagrass/archive/2012/12/06/392547.html澧欏鑽?/dc:creator>澧欏鑽?/author>Thu, 06 Dec 2012 06:31:00 GMThttp://www.67529968.com/javagrass/archive/2012/12/06/392547.htmlhttp://www.67529968.com/javagrass/comments/392547.htmlhttp://www.67529968.com/javagrass/archive/2012/12/06/392547.html#Feedback0http://www.67529968.com/javagrass/comments/commentRss/392547.htmlhttp://www.67529968.com/javagrass/services/trackbacks/392547.html甯?#29785;佺殑jquery鎻?#28000;剁殑?#20824;鏄?#37832;?#28641;?#28051;嬬殑鏍煎紡?#27537;锛?br />;(function($){    
$.fn.yourName = function(options){  //鍚勭?#23941;睘鎬?#37510;?#37721;傛暟
銆銆}
       var options = $.extend(defaults, options);//?#30078;涔?#37721;傛暟
       this.each(function(){
        //鎻?#28000;?#28729;炵幇浠爜
       });
    };
})(
jQuery);
娉?#29785;?#38171;?br />(1)銆?#8220;;(function($){    })(jQuery);”浣?#37922;簡鍖?#37722;?#37713;芥暟?#32029;琛?#32448;哄湪鏂规硶浣?#37712;呯殑”$”琛?#32448;虹殑灏?#37828;?#8221;jquery”,涓轰簡鏈夋洿濂界殑鍏煎鎬紝鎵浠湪鍓嶉潰娣诲姞涓涓?#37714;?#37721;?br />,杩?#38322;岀殑$绗?#37721;?#37828;?#28003;?#28051;?#37718;?#37722;?#37713;芥暟?#27537;褰?#37721;?br />(2)銆?.extend(defaults, options);琛?#32448;虹殑鏄?#28641;傛灉options涓殑鍙傛暟鎬?#37828;?#37832;?#37706;肩殑璇濓紝閭箞options涓殑鍊煎皢浼?#28000;?#37831;縟efaults涓殑鍊?#37510;?/div>

澧欏鑽?/a> 2012-12-06 14:31 鍙戣璇?#29825;?/a>
]]> ͼͼֽӡˢ
<optgroup id="iaykq"><small id="iaykq"></small></optgroup>
<menu id="iaykq"></menu>
<bdo id="iaykq"><nav id="iaykq"></nav></bdo>
  • <optgroup id="iaykq"><small id="iaykq"></small></optgroup>
    <menu id="iaykq"></menu>
    <bdo id="iaykq"><nav id="iaykq"></nav></bdo>