???C#??????????????
???????????? ???????[ 2015/9/7 10:56:44 ] ???????????????????
????????????
???????????????????????
?????????????????????????????????
???????????????????????
??????д????????????? var list = ImmutableList.Empty.Add(10).Add(20).Add(30);
???????????????????????
???????????????
????????????????????????ζ???/?????????????????????????????????????????????м???????????GC???????????????????伯?????
??????string??StringBuild?????Net???????伯???????????????????API?????????????????????
????ImmutableList<string> immutable = ImmutableList<string>.Empty;
????//???????????????????
????var immutable2 = immutable.ToBuilder();
????immutable2.Add("xx");
????immutable2.Add("xxx");
????//????????伯??
????immutable = immutable2.ToImmutable();
????????????????伯????????Builder?????????伯????????????????1000W?Σ?
?????????????£?
private static void List()
{
var list = new List<object>();
var sp = Stopwatch.StartNew();
for (int i = 0; i < 1000 * 10000; i++)
{
var obj = new object();
list.Add(obj);
}
Console.WriteLine("????б????:"+sp.Elapsed);
}
private static void BuilderImmutableList()
{
var list = ImmutableList<object>.Empty;
var sp = Stopwatch.StartNew();
var blist= list.ToBuilder();
for (int i = 0; i < 1000 * 10000; i++)
{
var obj = new object();
blist.Add(obj);
}
list=blist.ToImmutable();
Console.WriteLine("?????Builder?б????:"+sp.Elapsed);
}
private static void ImmutableList()
{
var list = ImmutableList<object>.Empty;
var sp = Stopwatch.StartNew();
for (int i = 0; i < 1000 * 10000; i++)
{
var obj = new object();
list = list.Add(obj);
}
Console.WriteLine("??????б????:" + sp.Elapsed);
}
???????????????????????в????????? ????string???????????????????????string???????????????????????
???????????? var pwd=”mushroomsir”????????????????洢??????У?????????????????????????????????????????????洢???????????У??κ??????dump???????????????????????????????????????
????????????????????net2.0??????SecureString?????а???洢?????????л?????????
????IntPtr addr = Marshal.SecureStringToBSTR(secureString);
????string temp = Marshal.PtrToStringBSTR(addr);
????Marshal.ZeroFreeBSTR(addr);
????WriteProcessMemory(...)
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11