求助,急用,大神帮一下忙,感激不尽

兰之羽翼 2014-04-10 01:54:28
C#实现
已知xml文件要求格式,现需要用拼接字符串方式,拼接出生成这样格式的xml文件
xml文件中一个是增加(insert)一个是更改(update),写一个判断方法,判断是更改还是增加
初次接触C#,因着急需要,希望大神帮一下忙,给出实例,如麻烦,可给出一部分,中间省略。
小弟初次接触,大神不要讲思路,我想看看代码,这次是紧急需要,以后再进一步请教原理和方法,请大神尽可能白话一些,专业术语,小弟一时揣摩不透,望大神朋友谅解
只有这些分了,全给了

下面是这个xml的格式:
<request>
<insert>
<fields>
<RepUser>
<RepID></RepID><!--主键-->
<OrgGrpID></OrgGrpID><!--所属部门-->
<Name></Name><!--名称-->
<Sex></Sex><!--性别-->
<LastName></LastName><!--姓-->
<FirstName></FirstName><!--名-->
<Country></Country><!--国家/地区-->
<ZipCode></ZipCode><!--邮编-->
<City></City><!--城市-->
<Street></Street ><!--街道-->
<CountryCode></CountryCode><!--国家代码-->
<Tel1></Tel1><!--电话1-->
<Tel2></Tel2><!--电话2-->
<Name></Name><!--名称-->
<Fax></Fax><!--传真-->
<New></New><!--创建日期-->
<Upd></Upd><!--更新日期-->
<E-mail1></E-mail1><!--电子邮件-->
<TMRep></TMRep><!--TM用户-->
<LanguageNo></LanguageNo><!--语言编号-->
<E-mail2></E-mail2><!--电子邮件2-->
<E-mailPriv></E-mailPriv><!--私人电子邮件-->
<Type></Type><!--类型-->
<Inactive></Inactive><!--离职-->
<SuperiorID></SuperiorID><!--上级-->
<ExtSystem></ExtSystem><!--外部系统-->
<ExtKey></ExtKey><!--外部主键-->
<HierarchyCode></HierarchyCode><!--层次结构代码-->
<ApproverRole></ApproverRole><!--审批人角色-->
<RepProperty></RepProperty><!--销售属性-->
<Position></Position><!--岗位-->
</RepUser>
</fields>
</insert>
</request>


<request>
<update>
<tables>
<table tablename="RepUser"/>
</tables>
<condition>
<cond tablename="RepUser" fieldname="RepID" op="=" value="88"/>
</condition>
<fields>
<RepUser>
<RepID></RepID><!--主键-->
<OrgGrpID></OrgGrpID><!--所属部门-->
<Name></Name><!--名称-->
<Sex></Sex><!--性别-->
<LastName></LastName><!--姓-->
<FirstName></FirstName><!--名-->
....
</RepUser>
</fields>
</update>
</request>
...全文
210 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
兰之羽翼 2014-04-11
  • 打赏
  • 举报
回复
引用 13 楼 guxingfeiyu 的回复:
类代码:

using System.Reflection;
namespace XMLRequst
{
    public class RepUser
    {
        private const string MAINKEY = "RepID";
        private int _RepID;//主键
        private string _OrgGrpID;//所属部门
        private string _Name;//名称
        private bool _Sex;//性别
        private string _LastName;//姓
        private string _FirstName;//名
        private string _Country;//国家/地区
        private string _ZipCode;//邮编
        private string _City;//城市
        private string _Street;//街道
        private string _CountryCode;//国家代码
        private string _Tel1;//电话1
        private string _Tel2;//电话2
        private string _Fax;//传真
        private DateTime _New;//创建日期
        private DateTime _Upd;//更新日期
        private string _E_mail1;//电子邮件
        private bool _TMRep;//TM用户
        private string _LanguageNo;//语言编号
        private string _E_mail2;//电子邮件2
        
        private string _E_mailPriv;//私人电子邮件
        private string _Type;//类型
        private bool _Inactive;//离职

        private int _SuperiorID;//上级
        private string _ExtSystem;//外部系统
        private string _ExtKey;//外部主键
        private string _HierarchyCode;//层次结构代码
        private string _ApproverRole;//审批人角色
        private string _RepProperty;//销售属性
        private string _Position;//岗位
        /// <summary>
        /// 输出格式,INSERT和UPDATE
        /// </summary>
        public ChangeType outputType;
        private Dictionary<string, bool> _propertiesChangeMap;

        public int RepID { get { return _RepID; } set { changeProperties("RepID" ,value); } }//主键
        public string OrgGrpID { get { return _OrgGrpID; } set { changeProperties("OrgGrpID", value); } }//所属部门
        public string Name { get { return _Name; } set { changeProperties("Name", value); } }//名称
        public bool Sex { get { return _Sex; } set { changeProperties("Sex", value); } }//性别
        public string LastName { get { return _LastName; } set { changeProperties("LastName", value); } }//姓
        public string FirstName { get { return _FirstName; } set { changeProperties("FirstName", value); } }//名
        public string Country { get { return _Country; } set { changeProperties("Country", value); } }//国家/地区
        public string ZipCode { get { return _ZipCode; } set { changeProperties("ZipCode", value); } }//邮编
        public string City { get { return _City; } set { changeProperties("City", value); } }//城市
        public string Street{ get { return _Street; } set { changeProperties("Street", value); } }//街道
        public string CountryCode { get { return _CountryCode; } set { changeProperties("CountryCode", value); } }//国家代码
        public string Tel1 { get { return _Tel1; } set { changeProperties("Tel1", value); } }//电话1
        public string Tel2 { get { return _Tel2; } set { changeProperties("Tel2", value); } }//电话2
        public string Fax{ get { return _Fax; } set { changeProperties("Fax", value); } }//传真
        public DateTime New { get { return _New; } set { changeProperties("New", value); } }//创建日期
        public DateTime Upd { get { return _Upd; } set { changeProperties("Upd", value); } }//更新日期
        public string E_mail1 { get { return _E_mail1; } set { changeProperties("E_mail1", value); } }//更新日期
        public bool TMRep { get { return _TMRep; } set { changeProperties("TMRep", value); } }//电子邮件
        public string LanguageNo { get { return _LanguageNo; } set { changeProperties("LanguageNo", value); } }//语言编号
        public string E_mail2 { get { return _E_mail2; } set { changeProperties("E_mail2", value); } }//电子邮件2

        public string E_mailPriv { get { return _E_mailPriv; } set { changeProperties("E_mailPriv", value); } }//私人电子邮件
        public string Type { get { return _Type; } set { changeProperties("Type", value); } }//类型
        public bool Inactive { get { return _Inactive; } set { changeProperties("Inactive", value); } }//离职

        public int SuperiorID { get { return _SuperiorID; } set { changeProperties("SuperiorID", value); } }//上级
        public string ExtSystem { get { return _ExtSystem; } set { changeProperties("ExtSystem", value); } }//外部系统
        public string ExtKey { get { return _ExtKey; } set { changeProperties("ExtKey", value); } }//外部主键
        public string HierarchyCode { get { return _HierarchyCode; } set { changeProperties("HierarchyCode", value); } }//层次结构代码
        public string ApproverRole { get { return _ApproverRole; } set { changeProperties("ApproverRole", value); } }//审批人角色
        public string RepProperty { get { return _RepProperty; } set { changeProperties("RepProperty", value); } }//销售属性
        public string Position { get { return _Position; } set { changeProperties("Position", value); } }//岗位
        public RepUser(){
            _New = DateTime.Now;
            _propertiesChangeMap = new Dictionary<string,bool>();
        }
        /// <summary>
        /// 修改属性
        /// </summary>
        /// <param name="propertyName">属性名</param>
        /// <param name="value">属性值</param>
        /// <returns></returns>
        private bool changeProperties(string propertyName,object value)
        {
            
            Type t = this.GetType();
            FieldInfo f = t.GetField("_" + propertyName, BindingFlags.NonPublic | BindingFlags.Instance);
            if (f == null)
                return false;
            f.SetValue(this, value);
            _Upd = DateTime.Now;
            //_propertiesChangeMap.Add(propertyName, true);
            //if (_propertiesChangeMap.ContainsKey(propertyName))
            //{
            //    _propertiesChangeMap.
            // }
            //_propertiesChangeMap.Add("Upd", true);
            _propertiesChangeMap["Upd"] = true;
            _propertiesChangeMap[propertyName] = true;
            return true;
        }
        /// <summary>
        /// 输出XML后或者需要修改输出方式时候先调用此函数再修改参数
        /// </summary>
        public void finishChange(){
            _propertiesChangeMap.Clear();
        }
        /// <summary>
        /// 输出XML格式的字串,如果其他地方需要使用原来的ToString函数,可将此函数改为新的函数,保留原ToString函数。
        /// </summary>
        /// <returns>类输出的XML格式</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            Type t = this.GetType();
            string result = null;
            string fields;
            //取得主键
            PropertyInfo mainKey = t.GetProperty(MAINKEY);
            if(mainKey == null)
                return null;
            
            
            //取得字段值
            fields = getFields();

            switch(outputType){
                case ChangeType.INSERT:
                    result = string.Format("<request>\r\n\t<insert>{0}\r\n\t</insert>\r\n</request>", fields);
                    break;
                case ChangeType.UPDATE:
                    result = string.Format("<request>\r\n\t<update>\r\n\t\t<tables>\r\n\t\t\t<table tablename='{0}'/>" +
                        "\r\n\t\t</tables>\r\n\t\t<condition>\r\n\t\t\t<cond tablename='{0}' " +
                       "fieldname='{1}' op='=' value='{2}'/>\r\n\t\t</condition>{3}\r\n\t</update>\r\n</request>",
                       t.Name,MAINKEY,mainKey.GetValue(this),fields);
                    break;
                default:
                    break;
            }
            finishChange();
            return result;
        }
        private string getFields()
        {
            Type t = this.GetType();

            StringBuilder sb = new StringBuilder(string.Format("\r\n\t\t<fields>\r\n\t\t\t<{0}>", t.Name));
            switch(outputType)
            {
                case ChangeType.INSERT:
                    PropertyInfo [] propertyInfos = t.GetProperties();
                    foreach(PropertyInfo propertyInfo in propertyInfos)
                    {
                        if(propertyInfo == null)continue;
                        if(propertyInfo.CanRead)
                        {//是公共属性
                            //特例:-不合法,字段使用_代替,这里需要恢复
                            string propertyInfoString = propertyInfo.Name.Replace('_', '-') ;
                            //特例:insert时候Upd不需要置值
                            if ("Upd".Equals(propertyInfoString))
                            {
                                sb.Append(string.Format("\r\n\t\t\t\t<{0}></{0}>", propertyInfoString));
                            }
                            else
                            {
                                sb.Append(string.Format("\r\n\t\t\t\t<{0}>{1}</{0}>", propertyInfoString, propertyInfo.GetValue(this)));
                            }
                        }
                    }
                    break;
                case ChangeType.UPDATE:
                    foreach(string propertyName in _propertiesChangeMap.Keys)
                    {
                        if(propertyName == null)continue;
                        PropertyInfo propertyInfo = t.GetProperty(propertyName);
                        if(propertyInfo == null)continue;
                        if(propertyInfo.CanRead)
                        {//是公共属性
                            //特例:-不合法,字段使用_代替,这里需要恢复
                            string propertyInfoString = propertyInfo.Name.Replace('_', '-');

                            sb.Append(string.Format("\r\n\t\t\t\t<{0}>{1}</{0}>", propertyInfoString, propertyInfo.GetValue(this)));
                        }
                    }
                    break;
                default:
                    break;
            }
            sb.Append(string.Format("\r\n\t\t\t</{0}>\r\n\t\t\t\t\r\n\t\t\t</fields>", t.Name));
            return sb.ToString();
        }
    }
    public enum  ChangeType
    {
        INSERT,
        UPDATE,
        DELETE
    }
}
朋友,这个程序,在vs里建什么工程?winform?
guxingfeiyu 2014-04-10
  • 打赏
  • 举报
回复
调用示例:

            RepUser repUser = new RepUser();
            repUser.City = "上海";
            repUser.Country = "中国";
            repUser.ApproverRole = "总经理";
            //输出insert的XML字串
              repUser.outputType = ChangeType.INSERT;
            Console.WriteLine("Insert request is:");
            Console.WriteLine(repUser);

            //输出update的XML字串
            
              repUser.City = "北京";
            repUser.Country = "中国";
            repUser.ApproverRole = "副总经理";
            repUser.outputType = ChangeType.UPDATE;
            Console.WriteLine("Update request is:");
            Console.WriteLine(repUser);
guxingfeiyu 2014-04-10
  • 打赏
  • 举报
回复
类代码:

using System.Reflection;
namespace XMLRequst
{
    public class RepUser
    {
        private const string MAINKEY = "RepID";
        private int _RepID;//主键
        private string _OrgGrpID;//所属部门
        private string _Name;//名称
        private bool _Sex;//性别
        private string _LastName;//姓
        private string _FirstName;//名
        private string _Country;//国家/地区
        private string _ZipCode;//邮编
        private string _City;//城市
        private string _Street;//街道
        private string _CountryCode;//国家代码
        private string _Tel1;//电话1
        private string _Tel2;//电话2
        private string _Fax;//传真
        private DateTime _New;//创建日期
        private DateTime _Upd;//更新日期
        private string _E_mail1;//电子邮件
        private bool _TMRep;//TM用户
        private string _LanguageNo;//语言编号
        private string _E_mail2;//电子邮件2
        
        private string _E_mailPriv;//私人电子邮件
        private string _Type;//类型
        private bool _Inactive;//离职

        private int _SuperiorID;//上级
        private string _ExtSystem;//外部系统
        private string _ExtKey;//外部主键
        private string _HierarchyCode;//层次结构代码
        private string _ApproverRole;//审批人角色
        private string _RepProperty;//销售属性
        private string _Position;//岗位
        /// <summary>
        /// 输出格式,INSERT和UPDATE
        /// </summary>
        public ChangeType outputType;
        private Dictionary<string, bool> _propertiesChangeMap;

        public int RepID { get { return _RepID; } set { changeProperties("RepID" ,value); } }//主键
        public string OrgGrpID { get { return _OrgGrpID; } set { changeProperties("OrgGrpID", value); } }//所属部门
        public string Name { get { return _Name; } set { changeProperties("Name", value); } }//名称
        public bool Sex { get { return _Sex; } set { changeProperties("Sex", value); } }//性别
        public string LastName { get { return _LastName; } set { changeProperties("LastName", value); } }//姓
        public string FirstName { get { return _FirstName; } set { changeProperties("FirstName", value); } }//名
        public string Country { get { return _Country; } set { changeProperties("Country", value); } }//国家/地区
        public string ZipCode { get { return _ZipCode; } set { changeProperties("ZipCode", value); } }//邮编
        public string City { get { return _City; } set { changeProperties("City", value); } }//城市
        public string Street{ get { return _Street; } set { changeProperties("Street", value); } }//街道
        public string CountryCode { get { return _CountryCode; } set { changeProperties("CountryCode", value); } }//国家代码
        public string Tel1 { get { return _Tel1; } set { changeProperties("Tel1", value); } }//电话1
        public string Tel2 { get { return _Tel2; } set { changeProperties("Tel2", value); } }//电话2
        public string Fax{ get { return _Fax; } set { changeProperties("Fax", value); } }//传真
        public DateTime New { get { return _New; } set { changeProperties("New", value); } }//创建日期
        public DateTime Upd { get { return _Upd; } set { changeProperties("Upd", value); } }//更新日期
        public string E_mail1 { get { return _E_mail1; } set { changeProperties("E_mail1", value); } }//更新日期
        public bool TMRep { get { return _TMRep; } set { changeProperties("TMRep", value); } }//电子邮件
        public string LanguageNo { get { return _LanguageNo; } set { changeProperties("LanguageNo", value); } }//语言编号
        public string E_mail2 { get { return _E_mail2; } set { changeProperties("E_mail2", value); } }//电子邮件2

        public string E_mailPriv { get { return _E_mailPriv; } set { changeProperties("E_mailPriv", value); } }//私人电子邮件
        public string Type { get { return _Type; } set { changeProperties("Type", value); } }//类型
        public bool Inactive { get { return _Inactive; } set { changeProperties("Inactive", value); } }//离职

        public int SuperiorID { get { return _SuperiorID; } set { changeProperties("SuperiorID", value); } }//上级
        public string ExtSystem { get { return _ExtSystem; } set { changeProperties("ExtSystem", value); } }//外部系统
        public string ExtKey { get { return _ExtKey; } set { changeProperties("ExtKey", value); } }//外部主键
        public string HierarchyCode { get { return _HierarchyCode; } set { changeProperties("HierarchyCode", value); } }//层次结构代码
        public string ApproverRole { get { return _ApproverRole; } set { changeProperties("ApproverRole", value); } }//审批人角色
        public string RepProperty { get { return _RepProperty; } set { changeProperties("RepProperty", value); } }//销售属性
        public string Position { get { return _Position; } set { changeProperties("Position", value); } }//岗位
        public RepUser(){
            _New = DateTime.Now;
            _propertiesChangeMap = new Dictionary<string,bool>();
        }
        /// <summary>
        /// 修改属性
        /// </summary>
        /// <param name="propertyName">属性名</param>
        /// <param name="value">属性值</param>
        /// <returns></returns>
        private bool changeProperties(string propertyName,object value)
        {
            
            Type t = this.GetType();
            FieldInfo f = t.GetField("_" + propertyName, BindingFlags.NonPublic | BindingFlags.Instance);
            if (f == null)
                return false;
            f.SetValue(this, value);
            _Upd = DateTime.Now;
            //_propertiesChangeMap.Add(propertyName, true);
            //if (_propertiesChangeMap.ContainsKey(propertyName))
            //{
            //    _propertiesChangeMap.
            // }
            //_propertiesChangeMap.Add("Upd", true);
            _propertiesChangeMap["Upd"] = true;
            _propertiesChangeMap[propertyName] = true;
            return true;
        }
        /// <summary>
        /// 输出XML后或者需要修改输出方式时候先调用此函数再修改参数
        /// </summary>
        public void finishChange(){
            _propertiesChangeMap.Clear();
        }
        /// <summary>
        /// 输出XML格式的字串,如果其他地方需要使用原来的ToString函数,可将此函数改为新的函数,保留原ToString函数。
        /// </summary>
        /// <returns>类输出的XML格式</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            Type t = this.GetType();
            string result = null;
            string fields;
            //取得主键
            PropertyInfo mainKey = t.GetProperty(MAINKEY);
            if(mainKey == null)
                return null;
            
            
            //取得字段值
            fields = getFields();

            switch(outputType){
                case ChangeType.INSERT:
                    result = string.Format("<request>\r\n\t<insert>{0}\r\n\t</insert>\r\n</request>", fields);
                    break;
                case ChangeType.UPDATE:
                    result = string.Format("<request>\r\n\t<update>\r\n\t\t<tables>\r\n\t\t\t<table tablename='{0}'/>" +
                        "\r\n\t\t</tables>\r\n\t\t<condition>\r\n\t\t\t<cond tablename='{0}' " +
                       "fieldname='{1}' op='=' value='{2}'/>\r\n\t\t</condition>{3}\r\n\t</update>\r\n</request>",
                       t.Name,MAINKEY,mainKey.GetValue(this),fields);
                    break;
                default:
                    break;
            }
            finishChange();
            return result;
        }
        private string getFields()
        {
            Type t = this.GetType();

            StringBuilder sb = new StringBuilder(string.Format("\r\n\t\t<fields>\r\n\t\t\t<{0}>", t.Name));
            switch(outputType)
            {
                case ChangeType.INSERT:
                    PropertyInfo [] propertyInfos = t.GetProperties();
                    foreach(PropertyInfo propertyInfo in propertyInfos)
                    {
                        if(propertyInfo == null)continue;
                        if(propertyInfo.CanRead)
                        {//是公共属性
                            //特例:-不合法,字段使用_代替,这里需要恢复
                            string propertyInfoString = propertyInfo.Name.Replace('_', '-') ;
                            //特例:insert时候Upd不需要置值
                            if ("Upd".Equals(propertyInfoString))
                            {
                                sb.Append(string.Format("\r\n\t\t\t\t<{0}></{0}>", propertyInfoString));
                            }
                            else
                            {
                                sb.Append(string.Format("\r\n\t\t\t\t<{0}>{1}</{0}>", propertyInfoString, propertyInfo.GetValue(this)));
                            }
                        }
                    }
                    break;
                case ChangeType.UPDATE:
                    foreach(string propertyName in _propertiesChangeMap.Keys)
                    {
                        if(propertyName == null)continue;
                        PropertyInfo propertyInfo = t.GetProperty(propertyName);
                        if(propertyInfo == null)continue;
                        if(propertyInfo.CanRead)
                        {//是公共属性
                            //特例:-不合法,字段使用_代替,这里需要恢复
                            string propertyInfoString = propertyInfo.Name.Replace('_', '-');

                            sb.Append(string.Format("\r\n\t\t\t\t<{0}>{1}</{0}>", propertyInfoString, propertyInfo.GetValue(this)));
                        }
                    }
                    break;
                default:
                    break;
            }
            sb.Append(string.Format("\r\n\t\t\t</{0}>\r\n\t\t\t\t\r\n\t\t\t</fields>", t.Name));
            return sb.ToString();
        }
    }
    public enum  ChangeType
    {
        INSERT,
        UPDATE,
        DELETE
    }
}
宝_爸 2014-04-10
  • 打赏
  • 举报
回复

            int repId = 1;
            int OrgGrpID = 11;
            string stringResult = @"<request> <insert> <fields>  <RepUser> <RepID>" + repId.ToString() + "</RepID><!--主键-->  <OrgGrpID>" + OrgGrpID.ToString() + "</OrgGrpID><!--所属部门-->";

部分代码。
兰之羽翼 2014-04-10
  • 打赏
  • 举报
回复
引用 9 楼 qingzhishuishou 的回复:
3楼就已经帮你拼接了开头一部分,你只需要把所有的拼接起来就好了
能不能帮一下,万分感谢
兰之羽翼 2014-04-10
  • 打赏
  • 举报
回复
引用 9 楼 qingzhishuishou 的回复:
3楼就已经帮你拼接了开头一部分,你只需要把所有的拼接起来就好了
朋友啊,我的意思就是能做一段代码,粘出一段代码来,有开头类,有结尾,放在vs里可以测试运行,因为拼接的太多,怕耽误你们时间,所以可以只拼接一点,我作参考。因为我从来没做过开发,所以只这样说一两句,我真的不懂啊,能不能稍微帮我一下,真的很感谢
qingzhishuishou 2014-04-10
  • 打赏
  • 举报
回复
3楼就已经帮你拼接了开头一部分,你只需要把所有的拼接起来就好了
兰之羽翼 2014-04-10
  • 打赏
  • 举报
回复
引用 7 楼 u013723255 的回复:
[quote=引用 4 楼 findcaiyzh 的回复:] 一般这种我会用XmlSerialzer,注释应该不需要吧。
汉字部分可以不要[/quote] 汉字部分可以不要,看能不能帮忙写一下,万分感激
兰之羽翼 2014-04-10
  • 打赏
  • 举报
回复
引用 4 楼 findcaiyzh 的回复:
一般这种我会用XmlSerialzer,注释应该不需要吧。
汉字部门可以不要
兰之羽翼 2014-04-10
  • 打赏
  • 举报
回复
引用 3 楼 findcaiyzh 的回复:
[quote=引用 2 楼 u013723255 的回复:] [quote=引用 1 楼 findcaiyzh 的回复:] 到底是要生成xml,还是解析xml?
生成xml,就是拼接字符串,拼接出这个xml格式,帮一下忙大侠[/quote] 拼接还用帮忙?就是几个字符串+在一起。 "<request> <insert> <fields> <RepUser> <RepID>"+repId.ToString() + "</RepID><!--主键--> <OrgGrpID>" + .... 这样就行。[/quote] 就是没接触过开发,没写过代码,这次需要这个,要求是别人给我的,我知道这也许对你们来说太容易太简单,可是我从来没写过代码没做过开发,所以才来求助,一两行代码,我也看不懂。我想要整个实现过程代码,就是有开头和结尾,中间字符串拼接,可以拼几个看看 xml文件中一个是增加(insert)一个是更改(update),写一个判断方法,判断是更改还是增加 不是还有参数什么的吗?比如<RepID></RepID>之间是不是要传个参数
宝_爸 2014-04-10
  • 打赏
  • 举报
回复
一般这种我会用XmlSerialzer,注释应该不需要吧。
宝_爸 2014-04-10
  • 打赏
  • 举报
回复
引用 2 楼 u013723255 的回复:
[quote=引用 1 楼 findcaiyzh 的回复:] 到底是要生成xml,还是解析xml?
生成xml,就是拼接字符串,拼接出这个xml格式,帮一下忙大侠[/quote] 拼接还用帮忙?就是几个字符串+在一起。 "<request> <insert> <fields> <RepUser> <RepID>"+repId.ToString() + "</RepID><!--主键--> <OrgGrpID>" + .... 这样就行。
兰之羽翼 2014-04-10
  • 打赏
  • 举报
回复
引用 1 楼 findcaiyzh 的回复:
到底是要生成xml,还是解析xml?
生成xml,就是拼接字符串,拼接出这个xml格式,帮一下忙大侠
宝_爸 2014-04-10
  • 打赏
  • 举报
回复
到底是要生成xml,还是解析xml?

110,502

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧