国产探花免费观看_亚洲丰满少妇自慰呻吟_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;

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泰安市| 延庆县| 苗栗市| 运城市| 富阳市| 如皋市| 辰溪县| 依安县| 昂仁县| 博野县| 抚顺县| 泰来县| 凤山市| 渭南市| 偃师市| 利川市| 新昌县| 巩义市| 汉中市| 高州市| 安新县| 郑州市| 碌曲县| 保靖县| 普兰县| 亚东县| 莱芜市| 龙里县| 昌平区| 河西区| 大渡口区| 凤翔县| 通山县| 阜宁县| 乌审旗| 夹江县| 瑞昌市| 宜章县| 裕民县| 页游| 嘉义县|