C#ÖÐstring×÷ΪÒýÓÃÀàÐÍÓëÀàµÄÇø±ðµÄÒ»¸öÎÊÌâ
RT¡£ÏÈÌù´úÂë
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Value_Ref_test1
{
class Program
{
static void Main(string[] args)
{
point a = new point (10,10) ;
point b = a;
a.x = 20;
Console.WriteLine(a.x);
Console.WriteLine(b.x);
}
}
public class point
{
public int x;
public int y;
public point(int Xvalue,int Yvalue)
{
this.x = Xvalue;
this.y = Yvalue;
}
}
}
ÕâÑùµÄ»°×îºó»áÊä³ö
20
20
ÒòΪa£¬bÁ½¸ö±äÁ¿ÒýÏòÁËͬһ¸ö¶ÑÄÚ´æÉϵĶÔÏó¡£
µ«ÊÇͬÑùstringÒ²ÊÇÒýÓÃÀàÐÍ¡£
C# code
string a ="123";
string b = a;
b = "321";
ÔÙÊä³öµÄ»°¾ÍÊÇb£¬a¾ÍÊÇ321,123¡£
¿¼ÂÇ¿ÉÄÜÊÇÓÉÓÚstringÔÚ±àÒëʱ±»ÄÚÖã¬ÓÚÊÇÓÖÊÔÁËһϷÇÄÚÖõÄstring£¨¸Ð¾õÕâÑùдstring²»»á±»ÄÚÖᣣ©
C# code
Random a = new Random();
string b = a.Next().ToString();
string c = b;
Console.WriteLine("b={0}",b);
Console.WriteLine("c={0}", c);
c = a.Next().ToString();
Console.WriteLine("b={0}", b);
Console.WriteLine("c={0}", c);
OK£¬×îºó½á¹ûb£¬c»¹ÊÇÊä³öµÄ²»Í¬½á¹û¡£¡£¡£
µÈ´ý¶®µÃÈ˽â´ðΪʲô¡£¡£¡£
Ïà¹ØÎĵµ£º
ÔÚasp.net¿ª·¢ÖУ¬¾³£»áÓõ½ºǫ́ºÍǰ̨µÄ½»»¥£¬¾Í´Ë×ܽáÁËÒ»µãc#ºÍjavascriptÏ໥²Ù×÷µÄ·½·¨
1.ÔÚºǫ́c#´úÂëÖе÷ÓÃjacascriptµÄ·½·¨
javascript´úÂ룺
<script type="text/javascript" language="javascript">
function test()
{
alert("oec2003");
return false;
}
</s ......
// °´Ä£°æ±ÈÀýÉú³ÉËõÂÔͼ£¨ÒÔÁ÷µÄ·½Ê½»ñȡԴÎļþ£©
//Éú³ÉËõÂÔͼº¯Êý
//˳Ðò²ÎÊý£ºÔ´Í¼ÎļþÁ÷¡¢ËõÂÔͼ´æ·ÅµØÖ·¡¢Ä£°æ¿í¡¢Ä£°æ¸ß
//×¢£ºËõÂÔͼ´óС¿ØÖÆÔÚÄ£°æÇøÓòÄÚ
public static void MakeSmallImg(System.IO.Stream fromFileStream,string fileSaveUrl,System.Double templateWidth,System.Double templateHeight)
{ ......
×÷Õߣº¹â½ÅѾ˼¿¼ ʱ¼ä£º12/23/2009 1:51:00 PM
Ò»¿ªÊ¼¾Í¾õµÃHTML±à¼Æ÷ÕâÍæÒâÓ¦¸ÃÊǺܸßÉîβâµÄ¡£ËæËæ±ã±ã¾ÍÏëÕûÒ»¸öÓ¦¸Ã²»ÊÇÒ»¼þÈÝÒ×µÄÊÂÇé¡£ºóÀ´¶ÔWebBrowser¿Ø¼þÓÐÁËһЩÁ˽⣬²»¹ý¶¼ÊǺܷôdzµÄÁ˽⡣ֻ֪µÀÓÃÕâ¸ö¿Ø¼þ¾ÍÄܹ»ÔÚ×Ô¼ºµÄ³ÌÐòÖиãÒ»¸öWEBä¯ÀÀÆ÷Ö®ÀàµÄ¶«Î÷£¬´ÓÀ´Ã»ÓÐÏë¹ýHTML±à¼Æ÷Ò²¿ÉÒÔʹÓÃÕâ¸ö¿Ø¼þÀ´ÊµÏ ......
2£©ÈçºÎ´´½¨Ò»¸öxmlÎĵµ
ÓÉÓÚxmlʵÖÊÒ²Ö»ÊÇÒ»¸öÎı¾Îļþ£¬ËùÒÔ×î¼òµ¥Äã¿ÉÒÔÖ±½ÓʹÓÃSystem.IOϵÄÀàÉú³ÉÒ»¸öÎļþ£¬²¢´æ´¢³ÉxmlÎļþ£¬µ±È»£¬ÄãÐèÒªÊÖ¶¯±£Ö¤¸ÃÎļþÐÎʽÁ¼ºÃ£¬±ÈÈç±ØÐëÓиùÔªËØ¡¢±ØÐëÓйرձêÇ©¡¢±ØÐëÕýȷǶÌ׵ȵȡ£
Èç¹ûÄãÀÁµÃ×Ô¼ºÈ¥ÏëÎļþµÄÐÎʽ£¬¿ÉÒÔʹÓÃSystem.XmlϵÄÀà¡£
Code
Xml ......
/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......