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»¹ÊÇÊä³öµÄ²»Í¬½á¹û¡£¡£¡£
µÈ´ý¶®µÃÈ˽â´ðΪʲô¡£¡£¡£
Ïà¹ØÎĵµ£º
// °´Ä£°æ±ÈÀýÉú³ÉËõÂÔͼ£¨ÒÔÁ÷µÄ·½Ê½»ñȡԴÎļþ£©
//Éú³ÉËõÂÔͼº¯Êý
//˳Ðò²ÎÊý£ºÔ´Í¼ÎļþÁ÷¡¢ËõÂÔͼ´æ·ÅµØÖ·¡¢Ä£°æ¿í¡¢Ä£°æ¸ß
//×¢£ºËõÂÔͼ´óС¿ØÖÆÔÚÄ£°æÇøÓòÄÚ
public static void MakeSmallImg(System.IO.Stream fromFileStream,string fileSaveUrl,System.Double templateWidth,System.Double templateHeight)
{ ......
Á¬½ÓAccess
Ê×ÏÈ¿´Ò»¸öÀý×Ó´úÂëÆ¬¶Ï:
³ÌÐò´úÂë:
--------------------------------------------------------------------------------
using System.Data;
using System.Data.OleDb;
......
string strConnection="Provider=Microsoft.Jet.OleDb.4.0;";
strConnection+=@"Data Source=C:\BegASPNET\Northwind.mdb" ......
Ò»¡¢SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡¡¡¡¡ð1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡¡¡¡¡ð2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºóÑ¡Ôñ czdImport Data£¨µ¼ÈëÊý¾Ý£©¡£
¡¡¡¡¡ ......
public class yzzSerialize
{
private yzzSerialize()
{ }
private static yzzCache cache = new yzzCache();
public static T GetfromXml<T>(string xmlpath, T t)
{
using (FileStream fs = new FileStream(xmlpath, FileMode.Open, FileAcces ......