惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Maxer`s Blog

用C#生成随机中文汉字验证码(转) 大家救命啊:系统表更新导致数据库崩溃,有没有办法还原? //以解决,谢谢大家关注 一些我收集的常用正则表达式 - Maxer`s Blog JS常用正则表达式 SQLServer和Access、Excel数据传输简单总结 动态SQL语句 转-javascript 问题集合 - Maxer`s Blog 使用Session常见问题集锦 - Maxer`s Blog TreeView控件问题汇总 ASP.NET 2.0学习笔记之$ - Maxer`s Blog ASP.NET 2.0学习笔记之Object Tag Syntax - Maxer`s Blog ASP.NET 2.0学习笔记之Code Directory 网站恢复正常了,感谢Howej ! 推荐一个好用的PDF转TXT软件 测试从dasblog发文章到博客园 [导入]注册了StartNow.CN域名 - Maxer`s Blog [导入]新年钟声响了,现在是2006了 [导入]今天去签了新电信息科技 [导入]应届毕业生该怎样准备你的未来 - Maxer`s Blog
序列化与反序列化 - Maxer`s Blog - 博客园
Maxer`s Blog · 2006-09-05 · via 博客园 - Maxer`s Blog

//测试代码
            FtpConfig config=new FtpConfig();
            config.FtpAddress="111.111.111.111";
            config.FtpMode="PASV";
            config.FtpPort="21";
            config.UserName="abc";
            config.PassWord="abcd";
            XmlSerializer xmlSer=new XmlSerializer(typeof(FtpConfig));
            FileStream stream = new FileStream("test.xml", FileMode.OpenOrCreate);
            xmlSer.Serialize( stream, config );    
            stream.Flush();
            stream.Close();

            FileStream stream2 = new FileStream("test.xml", FileMode.Open,FileAccess.Read);
            FtpConfig config2=(FtpConfig)xmlSer.Deserialize(stream2);
            stream2.Close();      

// FtpConfig 类

using System;
using System.Xml.Serialization;

namespace upfile
{
    /// <summary>
    /// FtpConfig 的摘要说明。
    /// </summary>
    [Serializable]
    public class FtpConfig
    {
        public FtpConfig()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        #region 字段
        private string _ftpAddress;
        private string _ftpPort;
        private string _ftpMode;
        private string _userName;
        private string _passWord;
        #endregion

                #region 属性    

            public string FtpAddress
        {
            get
            {
                return _ftpAddress;
            }
            set
            {
                _ftpAddress=value;
            }
        }

            public string FtpPort{
            get
            {
                return _ftpPort;
            }
            set
            {
                _ftpPort=value;
            }
        }

                    public string FtpMode
        {
            get
            {
                return _ftpMode;
            }
            set
            {
                _ftpMode=value;
            }
        }
        public string UserName
        {
            get
            {
                return _userName;
            }
            set
            {
                _userName=value;
            }
        }
        public string PassWord
        {
            get
            {
                return _passWord;
            }
            set
            {
                _passWord=value;
            }
        }

        #endregion

    }
}

posted on 2006-09-05 10:44  Maxer`s Blog  阅读(357)  评论()    收藏  举报