国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

C#學習筆記之八(Serialization, ActiveX Control)

2024-07-21 02:19:43
字體:
來源:轉載
供稿:網友
serialization:
1. use attribute
// "[serializable]"
2. formatter
// "binaryformatter binaryformatter = new binaryformatter();"
3.[noserialized]

//example
// if the data can generate based some data, then no need to serialize them.
// overload the onserialization() method to do the caculate work
[serializable]
class products : ideserializationcallback
{
private long statnumber = 1;
private long endnumber;
[nonserialized] private long[] theproducts;
...
public static void main()
{
products p = new products(1, 10);
p.serialize();
products p2 = products.deserialize();
p2.displayproducts();
}
public void serialize()
{
filestream filestream =
new filestream("doproducts1.out", filemode.create);
binaryformatter.serialize(filestream, this);
filestream.close();
}
public static products deserialize()
{
filestream filestream =
new filestream("doproduct1.out", filemode.open);
binaryformatter binaryformattter =
new binaryformatter();
products p = (products) binaryformatter.deserialize(filestream);
filestream.close();
return p;
}

pubic virtual void ondeserialization(object sender)
{
//caculate the none serialized data based on the serialized data
}

}

activex control:
1. write in vb or vc
2. register activex control in dos command windows
regsvr32 a.ocx
3. add control to c# project
// tool->customize toolbox->com components->select your component
4. call
// label1.text = axcalculator.add(ref left, ref right).tostring;

最大的網站源碼資源下載站,

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乐陵市| 林西县| 霍州市| 绥滨县| 崇信县| 凌海市| 新巴尔虎右旗| 牙克石市| 鹿邑县| 黔西| 壶关县| 疏勒县| 公安县| 黄龙县| 三河市| 濉溪县| 安溪县| 分宜县| 武平县| 台北县| 崇阳县| 海丰县| 阿荣旗| 都匀市| 铜陵市| 剑河县| 出国| 漳州市| 咸宁市| 白水县| 门源| 彰化县| 马关县| 略阳县| 禄丰县| 舒城县| 贡嘎县| 南充市| 襄垣县| 突泉县| 汶上县|