C# 发送xml报文到用友U8生成凭证系列一(配置信息)_源码 生成u8 会计凭证-程序员宅基地

技术标签: .NET And C#  xml报文  U8凭证  用友U8  

C# 发送xml报文到用友U8生成凭证系列一(配置信息)
C# 发送xml报文到用友U8生成凭证系列二(基础代码)
C# 发送xml报文到用友U8生成凭证系列三(Modal代码)
C# 发送xml报文到用友U8生成凭证系列四(Biz代码)最终代码

在项目过程中,需要把平台上生成的凭证xml报文发送到用友U8中生成凭证,供财务好做账,因此就有此系列文章产生:本文将讲解前期准备工作。及要发送xml报文的格式。

项目主要包括如下:


本文将先讲解 u8voucher.xml、Web.config、U8EAI.asmx、EAIHandler.cs等代码

XML报文格式如下:

 <!--凭证 roottag:类型 billtype:系统用 docid:唯一编号 receiver:接收方 sender:发送方编码 proc:操作码 codeexcanged:导入时编码是否转换  exportneedexch导出时是否要根据对照表替换 renewproofno重新编号 -->
  <ufinterface account="002" billtype="gl" filename="" isexchange="Y" proc="add" receiver="8201" replace="Y" 
        roottag="" sender="glv" subbilltype="">
    <voucher id="6c26dc32-81d0-4b39-a355-5c15b16769b1">
      <voucher_head>
        <company>8201</company>
        <voucher_type>A</voucher_type>
        <fiscal_year>2018</fiscal_year>
        <accounting_period>01</accounting_period>
        <voucher_id />
        <attachment_number>1</attachment_number>
        <prepareddate>2018-01-25</prepareddate>
        <enter>5329068</enter>
        <cashier />
        <signature>N</signature>
        <checker />
        <posting_date />
        <posting_person />
        <operator />
        <revokeflag>N</revokeflag>
        <voucherkind>0</voucherkind>
        <voucher_making_system>结算平台</voucher_making_system>
        <memo1 />
        <memo2 />
        <reserve1 />
        <reserve2 />
      </voucher_head>
      <voucher_body>
        <entry>
          <entry_id>1</entry_id>
          <account_code>10020101</account_code>
          <abstract>收黑龙江省隆盛进出口有限公司ZP1801240157</abstract>
          <settlement>P01</settlement>
          <document_id />
          <document_date>2018-01-24</document_date>
          <currency>CNY</currency>
          <unit_price>1.00</unit_price>
          <exchange_rate1>0.0000</exchange_rate1>
          <exchange_rate2>1.0000</exchange_rate2>
          <debit_quantity>0.00</debit_quantity>
          <primary_debit_amount>922.00</primary_debit_amount>
          <secondary_debit_amount>0.00</secondary_debit_amount>
          <natural_debit_currency>922.00</natural_debit_currency>
          <credit_quantity>0.00</credit_quantity>
          <primary_credit_amount>0.00</primary_credit_amount>
          <secondary_credit_amount>0.00</secondary_credit_amount>
          <natural_credit_currency>0.00</natural_credit_currency>
          <auxiliary_accounting />
          <bill_type />
          <bill_id />
          <bill_date />
          <detail />
          <free1 />
          <freeitem1 />
          <freeitem2 />
          <freeitem3 />
          <freeitem4 />
          <freeitem5 />
          <freeitem6 />
          <freeitem7 />
          <freeitem8 />
          <freeitem9 />
          <freeitem10 />
          <freeitem11 />
          <freeitem12 />
          <freeitem13 />
          <freeitem14 />
          <freeitem15 />
          <freeitem16 />
          <freeitem17 />
          <freeitem18 />
          <freeitem19 />
          <freeitem20 />
          <freeitem21 />
          <freeitem22 />
          <freeitem23 />
          <freeitem24 />
          <freeitem25 />
          <freeitem26 />
          <freeitem27 />
          <freeitem28 />
          <freeitem29 />
          <freeitem30 />
        </entry>
        <entry>
          <entry_id>2</entry_id>
          <account_code>11220108</account_code>
          <abstract>收黑龙江省隆盛进出口有限公司报关费等</abstract>
          <settlement />
          <document_id>HX1801240002</document_id>
          <document_date>2018-01-24</document_date>
          <currency>CNY</currency>
          <unit_price>1.00</unit_price>
          <exchange_rate1>0.0000</exchange_rate1>
          <exchange_rate2>1.0000</exchange_rate2>
          <debit_quantity>0.00</debit_quantity>
          <primary_debit_amount>0.00</primary_debit_amount>
          <secondary_debit_amount>0.00</secondary_debit_amount>
          <natural_debit_currency>0.00</natural_debit_currency>
          <credit_quantity>0.00</credit_quantity>
          <primary_credit_amount>922.00</primary_credit_amount>
          <secondary_credit_amount>0.00</secondary_credit_amount>
          <natural_credit_currency>922.00</natural_credit_currency>
          <auxiliary_accounting>
            <item name="客商辅助核算">GT16110214</item>
          </auxiliary_accounting>
          <bill_type />
          <bill_id />
          <bill_date />
          <detail />
          <free1 />
          <freeitem1>HX1801240002</freeitem1>
          <freeitem2 />
          <freeitem3 />
          <freeitem4 />
          <freeitem5 />
          <freeitem6 />
          <freeitem7 />
          <freeitem8 />
          <freeitem9 />
          <freeitem10 />
          <freeitem11 />
          <freeitem12 />
          <freeitem13 />
          <freeitem14 />
          <freeitem15 />
          <freeitem16 />
          <freeitem17 />
          <freeitem18 />
          <freeitem19 />
          <freeitem20 />
          <freeitem21 />
          <freeitem22 />
          <freeitem23 />
          <freeitem24 />
          <freeitem25 />
          <freeitem26 />
          <freeitem27 />
          <freeitem28 />
          <freeitem29 />
          <freeitem30 />
        </entry>
      </voucher_body>
    </voucher>
  </ufinterface>
 <!-- 现将各数据项说明如下 


 voucher_head 凭证头:


       company                 公司的名称或编号,U8用户不用填写,给NC用户使用


    voucher_type         nvarchar(2)    凭证类别        *不能为空


    fiscal_year                  凭证所属的会计年度 *不能为空


    accounting_period     tinyint        所属的会计期间    *不能为空


    voucher_id         smallint    凭证号       *当节点ufinterface属性renewproofno="false"或renewproofno=""时,不能为空;renewproofno="true"时,可以为空


    attachment_number     smallint    所附单据的数量  


    date             datetime    制单日期      *不能为空


    enter             nvarchar(20)    制单人名称      


      cashier         nvarchar(20)    出纳名称       


      signature         bit        是否已签字      


      checker         nvarchar(20)    审核人名称       


    posting_date         datetime    记账日期       


      posting_person         nvarchar(20)    记账人名称       


    voucher_making_system     nvarchar(10)    制单系统标示,导入时必须填GL,即总帐系统单据      


       memo1             nvarchar (10)    备注1       


       memo2             nvarchar (10)    备注2       


       reserve1        nvarchar (20)    保留(外部凭证业务类型) 


       reserve2        nvarchar (50)    保留(外部凭证业务号)   


        revokeflag                作废凭证此字段填1,正常凭证不填,有错凭证填2


 voucher_body 凭证体:


     entry_id         smallint    分录号      


     account_code         nvarchar(15)    科目编码       


     abstract         nvarchar(60)    摘要           


      settlement         nvarchar (3)    结算方式,在科目是银行或往来时,可以填写此项    


     document_id         nvarchar (30)    票据号,在科目是银行或往来时,可以填写此项         


     document_date         datetime    票据日期,在科目是银行或往来时,可以填写此项      


     currency         nvarchar (8)    币种           


     unit_price                 单价,在科目有数量核算时,填写此项 


     exchange_rate1         float        汇率1 主辅币核算时使用 折辅汇率 原币*汇率1=辅币  NC用户使用


     exchange_rate2         float        汇率2 折主汇率 折本汇率 本币*汇率2=主币,U8用户使用


     debit_quantity         float        借方数量,在科目有数量核算时,填写此项     


     primary_debit_amount     money        原币借方发生额  


     secondary_debit_amount     money        辅币借方发生额     


     natural_debit_currency     money        本币借方发生额     *与本币贷方发生额不能同时为空


     credit_quantity     float        贷方数量,在科目有数量核算时,填写此项


     primary_credit_amount     money        原币贷方发生额     


     secondary_credit_amount money        辅币贷方发生额     


     natural_credit_currency money        本币贷方发生额   *与本币借方发生额不能同时为空    


     bill_type        nvarchar (20)    原始单据类型,导入凭证时填空     


      bill_id         nvarchar (30)    原始单据编号,导入凭证时填空      


      bill_date         datetime    原始单据日期,导入凭证时填空     


     auxiliary_accounting     辅助核算     


                dept_id     nvarchar (12)    部门        *科目有部门核算时不能为空


                cperson_id     nvarchar (8)     人员        *科目有个人核算时不能为空


                ccus_id     nvarchar (20)    客户        *科目有客户核算时不能为空      


                csup_id     nvarchar (12)    供应商        *科目有供应商核算时不能为空       


            item_class     nvarchar(2)     项目大类    *科目有项目核算时不能为空     


                citem_id     nvarchar (20)    项目档案    *科目有项目核算时不能为空                     


            operator      nvarchar (20)    业务员         


        define1     nvarchar 20    自定义字段1


        define2     nvarchar 20    自定义字段2


        define3     nvarchar 20    自定义字段3


        define4     datetime    自定义字段4


        define5     smallint    自定义字段5


        define6     datetime    自定义字段6


        define7     float        自定义字段7


        define8     nvarchar 4    自定义字段8


        define9     nvarchar 8    自定义字段9


        define10     nvarchar 60    自定义字段10


        define11     nvarchar 120    自定义字段11


        define12     nvarchar 120    自定义字段12


        define13     nvarchar 120    自定义字段13


        define14     nvarchar 120    自定义字段14


        define15     int        自定义字段15


        define16     float        自定义字段16    


        detail 明细


                cash_flow_statement         现金流量表


                cash_flow             现金流量   三个属性:


            cash_item          现金流量项目


            natural_debit_currency     借方金额


            natural_credit_currency 贷方金额


        code_remark_statement        科目备查簿


            code_remark i_id="1"    备查第一条记录


                item name=""     项目名称及其值,同一记录有多个item


-->

Config配置文件:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="NC2U8.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
    </sectionGroup>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <appSettings file="Config/appSetting.config"/>
  <connectionStrings>
    <add name="UFDATA_023_2015ConnectionString" connectionString="Data Source=192.168.10.221;Initial Catalog=UFDATA_001;
Persist Security Info=True;User ID=sa;Password=sa123456" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <!--
      通过 <authentication> 节,可配置 
      ASP.NET 用于识别进入用户的 
      安全身份验证模式。
    -->
    <authentication mode="Windows"/>
    <!--
       通过 <customErrors> 节,可以配置
       在执行请求的过程中出现未处理的错误时要执行 
       的操作。具体而言,
       开发人员通过该节可配置要显示的 html 错误页,
       以代替错误堆栈跟踪。

       <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
         <error statusCode="403" redirect="NoAccess.htm" />
         <error statusCode="404" redirect="FileNotFound.htm" />
       </customErrors>
    -->
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </controls>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpModules>
  </system.web>
  <applicationSettings>
    <NC2U8.Properties.Settings>
      <setting name="NC2U8_WebReference_XsnService" serializeAs="String">
        <value>http://192.163.122.244:8083/XersonService.asmx</value>
      </setting>
    </NC2U8.Properties.Settings>
  </applicationSettings>
  <system.codedom>
      <compilers>
        <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
          <providerOption name="CompilerVersion" value="v3.5"/>
          <providerOption name="WarnAsError" value="false"/>
      </compiler>
    </compilers>
  </system.codedom>
  <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="ScriptModule"/>
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

一般处理程序U8EAI.asmx代码:

 /// <summary>
    /// U8EAI 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://www.xxx.com.cn/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]

    public class U8EAI : System.Web.Services.WebService
    {        
        /// <summary>
        /// u8数据导入服务
        /// </summary>
        /// <param name="type">数据类型。凭证为voucher</param>
        /// <param name="data">传入的数据字符串</param>
        /// <returns></returns>
        [WebMethod]
        public string Action(string type,string data)
        {
            var handler = new EAIHandler();
            return System.Web.HttpUtility.HtmlDecode(handler.Send(type, data));
        }

    }

U8 EAI 处理类代码:

using NC2U8.Biz;
using NC2U8.Modal;
using System;
using System.Text;
using System.Xml;
using System.Linq;
using System.Xml.Linq;
namespace NC2U8
{
    public class EAIHandler
    {
       /// <summary>
        /// 返回转换后的U8xml格式
       /// </summary>
       /// <param name="type">类型</param>
       /// <param name="vcNo">VC编号</param>
       /// <param name="data">返回的XML数据</param>
       /// <returns></returns>
        public string Send(string type,string data)
        {
            ResultInfo rInfo = new ResultInfo();
            string result;
            try
            { 
                var convertor = new Route.Router().GetConvertor(type);
                var accepter = new EaiAccepter(convertor);
                var splitXml = accepter.Send(data).Split('|');
                //返回凭证结果
                var ReturnU8xml = string.Empty;
                var successInfo = "false";
                XDocument doc = XDocument.Parse(splitXml[1]);
                var RssXml = from p in doc.Descendants("item") select p;
                if (RssXml.Count() > 0)
                {
                    //2016/11/10 修正
                    //判断一个节点是否存在,不存在则为保存成功或者其他凭证错误信息
                    if (RssXml.Attributes("key").Count() > 0)
                    {
                        foreach (var item in RssXml)
                        {//数据重复上传信息/其他错误
                            ReturnU8xml = splitXml[0] + "-" + item.Attribute("dsc").Value.ToString() + ",请检查结算凭证/U8(科目代码)及生成日期";
                        }
                        successInfo = "false";
                    }
                    else
                    {
                        foreach (var item in RssXml)
                        {
                            //凭证保存成功
                            if (item.Attribute("succeed").Value == "0")
                            {
                                ReturnU8xml = splitXml[0] + "-" + item.Attribute("voucher_type").Value.ToString() + "-" + item.Attribute("voucher_id").Value.ToString() + "," + item.Attribute("dsc").Value.ToString();
                                successInfo = "true";
                            }
                            //导入失败的
                            else
                            {
                                //<item key="" succeed="601" dsc="EAI数据源(default)@001连接失败,原因:口令不正确!" />
                                var entry_id = item.Attribute("entry_id").Value.ToString() == "" ? "0" : item.Attribute("entry_id").Value.ToString();
                                var xml = splitXml[0] + "-" + item.Attribute("voucher_type").Value.ToString() + "-" + item.Attribute("voucher_id").Value.ToString() + "|行号:"
                                    + entry_id + "~" + item.Attribute("dsc").Value.ToString() + ";\r\n"; //Environment.NewLine;
                                ReturnU8xml += xml;
                                successInfo = "false";
                            }
                        }
                    }
                }
                else
                {
                    ReturnU8xml = "未知错误,请检查结算凭证/U8(科目代码)及生成日期";
                    successInfo = "false";
                }
                rInfo.result = ReturnU8xml;
                rInfo.success = successInfo;//"true";
                rInfo.message = string.Empty;
            }
            catch(Exception ex)
            {
                rInfo.success = "false";
                rInfo.message = ex.Message;
                rInfo.result = string.Empty;
                //记录报错原因
                result = ex.Message;
            }
          
            using(var ms = new System.IO.MemoryStream())
            {
                XmlWriterSettings setting = new XmlWriterSettings();
                setting.Encoding = new UTF8Encoding(false);
                setting.Indent = true;
                using(var xw = XmlWriter.Create(ms,setting))
                {
                    var serializer = new System.Xml.Serialization.XmlSerializer(typeof(ResultInfo));
                    //Create our own namespaces for the output
                    System.Xml.Serialization.XmlSerializerNamespaces ns = new System.Xml.Serialization.XmlSerializerNamespaces();
                    //Add an empty namespace and empty value
                    ns.Add("", "");//去除节点中的xmlns:xsi 属性
                    serializer.Serialize(xw,rInfo,ns);
                    result = Encoding.UTF8.GetString(ms.ToArray());
                }
            }
            return result;
        }

        public class ReslutU8Xml
        {

        }
    }
}

前期配置及基础代码大体如上,接下来将详细讲解 怎么转换xml节点

服务器用友U8 EAI配置:

IIS默认显示:


版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/kongwei521/article/details/79702752

智能推荐

5个超厉害的资源搜索网站,每一款都可以让你的资源满满!_最全资源搜索引擎-程序员宅基地

文章浏览阅读1.6w次,点赞8次,收藏41次。生活中我们无时不刻不都要在网站搜索资源,但就是缺少一个趁手的资源搜索网站,如果有一个比较好的资源搜索网站可以帮助我们节省一大半时间!今天小编在这里为大家分享5款超厉害的资源搜索网站,每一款都可以让你的资源丰富精彩!网盘传奇一款最有效的网盘资源搜索网站你还在为找网站里面的资源而烦恼找不到什么合适的工具而烦恼吗?这款网站传奇网站汇聚了4853w个资源,并且它每一天都会持续更新资源;..._最全资源搜索引擎

Book类的设计(Java)_6-1 book类的设计java-程序员宅基地

文章浏览阅读4.5k次,点赞5次,收藏18次。阅读测试程序,设计一个Book类。函数接口定义:class Book{}该类有 四个私有属性 分别是 书籍名称、 价格、 作者、 出版年份,以及相应的set 与get方法;该类有一个含有四个参数的构造方法,这四个参数依次是 书籍名称、 价格、 作者、 出版年份 。裁判测试程序样例:import java.util.*;public class Main { public static void main(String[] args) { List <Book>_6-1 book类的设计java

基于微信小程序的校园导航小程序设计与实现_校园导航微信小程序系统的设计与实现-程序员宅基地

文章浏览阅读613次,点赞28次,收藏27次。相比于以前的传统手工管理方式,智能化的管理方式可以大幅降低学校的运营人员成本,实现了校园导航的标准化、制度化、程序化的管理,有效地防止了校园导航的随意管理,提高了信息的处理速度和精确度,能够及时、准确地查询和修正建筑速看等信息。课题主要采用微信小程序、SpringBoot架构技术,前端以小程序页面呈现给学生,结合后台java语言使页面更加完善,后台使用MySQL数据库进行数据存储。微信小程序主要包括学生信息、校园简介、建筑速看、系统信息等功能,从而实现智能化的管理方式,提高工作效率。

有状态和无状态登录

传统上用户登陆状态会以 Session 的形式保存在服务器上,而 Session ID 则保存在前端的 Cookie 中;而使用 JWT 以后,用户的认证信息将会以 Token 的形式保存在前端,服务器不需要保存任何的用户状态,这也就是为什么 JWT 被称为无状态登陆的原因,无状态登陆最大的优势就是完美支持分布式部署,可以使用一个 Token 发送给不同的服务器,而所有的服务器都会返回同样的结果。有状态和无状态最大的区别就是服务端会不会保存客户端的信息。

九大角度全方位对比Android、iOS开发_ios 开发角度-程序员宅基地

文章浏览阅读784次。发表于10小时前| 2674次阅读| 来源TechCrunch| 19 条评论| 作者Jon EvansiOSAndroid应用开发产品编程语言JavaObjective-C摘要:即便Android市场份额已经超过80%,对于开发者来说,使用哪一个平台做开发仍然很难选择。本文从开发环境、配置、UX设计、语言、API、网络、分享、碎片化、发布等九个方面把Android和iOS_ios 开发角度

搜索引擎的发展历史

搜索引擎的发展历史可以追溯到20世纪90年代初,随着互联网的快速发展和信息量的急剧增加,人们开始感受到了获取和管理信息的挑战。这些阶段展示了搜索引擎在技术和商业模式上的不断演进,以满足用户对信息获取的不断增长的需求。

随便推点

控制对象的特性_控制对象特性-程序员宅基地

文章浏览阅读990次。对象特性是指控制对象的输出参数和输入参数之间的相互作用规律。放大系数K描述控制对象特性的静态特性参数。它的意义是:输出量的变化量和输入量的变化量之比。时间常数T当输入量发生变化后,所引起输出量变化的快慢。(动态参数) ..._控制对象特性

FRP搭建内网穿透(亲测有效)_locyanfrp-程序员宅基地

文章浏览阅读5.7w次,点赞50次,收藏276次。FRP搭建内网穿透1.概述:frp可以通过有公网IP的的服务器将内网的主机暴露给互联网,从而实现通过外网能直接访问到内网主机;frp有服务端和客户端,服务端需要装在有公网ip的服务器上,客户端装在内网主机上。2.简单的图解:3.准备工作:1.一个域名(www.test.xyz)2.一台有公网IP的服务器(阿里云、腾讯云等都行)3.一台内网主机4.下载frp,选择适合的版本下载解压如下:我这里服务器端和客户端都放在了/usr/local/frp/目录下4.执行命令# 服务器端给执_locyanfrp

UVA 12534 - Binary Matrix 2 (网络流‘最小费用最大流’ZKW)_uva12534-程序员宅基地

文章浏览阅读687次。题目:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93745#problem/A题意:给出r*c的01矩阵,可以翻转格子使得0表成1,1变成0,求出最小的步数使得每一行中1的个数相等,每一列中1的个数相等。思路:网络流。容量可以保证每一行和每一列的1的个数相等,费用可以算出最小步数。行向列建边,如果该格子是_uva12534

免费SSL证书_csdn alphassl免费申请-程序员宅基地

文章浏览阅读504次。1、Let's Encrypt 90天,支持泛域名2、Buypass:https://www.buypass.com/ssl/resources/go-ssl-technical-specification6个月,单域名3、AlwaysOnSLL:https://alwaysonssl.com/ 1年,单域名 可参考蜗牛(wn789)4、TrustAsia5、Alpha..._csdn alphassl免费申请

测试算法的性能(以选择排序为例)_算法性能测试-程序员宅基地

文章浏览阅读1.6k次。测试算法的性能 很多时候我们需要对算法的性能进行测试,最简单的方式是看算法在特定的数据集上的执行时间,简单的测试算法性能的函数实现见testSort()。【思想】:用clock_t计算某排序算法所需的时间,(endTime - startTime)/ CLOCKS_PER_SEC来表示执行了多少秒。【关于宏CLOCKS_PER_SEC】:以下摘自百度百科,“CLOCKS_PE_算法性能测试

Lane Detection_lanedetectionlite-程序员宅基地

文章浏览阅读1.2k次。fromhttps://towardsdatascience.com/finding-lane-lines-simple-pipeline-for-lane-detection-d02b62e7572bIdentifying lanes of the road is very common task that human driver performs. This is important ..._lanedetectionlite

推荐文章

热门文章

相关标签