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

推荐订阅源

IT之家
IT之家
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
K
Kaspersky official blog
V
Visual Studio Blog
博客园 - 聂微东
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
C
Check Point Blog
H
Heimdal Security Blog
The GitHub Blog
The GitHub Blog
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
AI
AI
The Register - Security
The Register - Security
SecWiki News
SecWiki News
Help Net Security
Help Net Security
T
Troy Hunt's Blog
V
V2EX
T
Tenable Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Forbes - Security
Forbes - Security
P
Privacy International News Feed
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
Recorded Future
Recorded Future
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 司徒正美
博客园 - 叶小钗
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
S
Security @ Cisco Blogs
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
The Cloudflare Blog
Jina AI
Jina AI
T
The Exploit Database - CXSecurity.com
L
Lohrmann on Cybersecurity
Webroot Blog
Webroot Blog
美团技术团队
N
News and Events Feed by Topic
小众软件
小众软件
Google DeepMind News
Google DeepMind News
G
GRAHAM CLULEY
阮一峰的网络日志
阮一峰的网络日志
B
Blog

博客园 - Maxer`s Blog

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

    }
}