当前位置: 首页 > 开发总结 > 正文

C# Z39.50客户端 含全部源代码附demo演示源码

再VB、Delphi时代,实现z39.50客户端有一个yaz vbzoom的工具包,利用第三方开发包我们可以很快的实现。本文介绍如何使用c#实现Z39.50客户端,当然是纯源码方式不依赖第三方。如果您是一个开发人员要求不但熟练C# soket编程,而且要了解Z39.50协议以及基本流程。

建立z39服务器连接

这里只需要z39.50服务器IP地址与端口2个参数。建立soket连接 new TcpClient(this.m_strHostName, this.m_nPort);如果连接失败捕获异常并返回。

Z39.50初始化Initial

这里需要包含的参数就是常见的 用户名、 密码、 组号、认证方式(公开 or 需要密码验证),把这些参数 赋值给 INIT_REQUEST 类并打包发送出去

Z39.50检索Search

这里是关键的一步了,客户端把检索需要的参数封装到SEARCH_REQUEST类并打包发送出去。这里需要注意几个参数:

  • PreferredRecordSyntax 数据格式

常见的值有:

//1.2.840.10003.5.1 — UNIMARC
//1.2.840.10003.5.10 — MARC21
//1.2.840.10003.5.101 — SUTRS
//1.2.840.10003.5.109.10 — XML

 Query-type and Query. The parameter Query-type identifies the type of query, i.e the syntax of parameter Query. Six types are defined:

Type-0 may be used only when the origin and target have a priori agreement outside of the standard.
Type-1 is the Reverse Polish Notation (RPN) query specified in 3.7.
Type-2 is the ISO8777 type query, specified in ISO 8777.
Type-100 is the Z39.58 type query, specified in ANSI Z39.58.
Type-101 is the extended RPN (ERPN) query, an extension to the type-1 query to allow proximity searching and restriction of result sets by attributes. It is specified in 3.7. Note: The type-101 query is identical to the type-1 query with the following exception: For type-1, proximity and restriction are valid only when version 3 is in force. For type-101, proximity and restriction are valid both for version 3 and version 2 as well. (The definition of the type-101 query is independent of version.)
Type-102 is the Ranked List query, to be defined in a later version of this standard.

如果检索命中了记录,就会返回命中结果数ResultCount

返回命中记录Present

如果命中了记录我们就要取回指定的记录这里参数注意包括

数据格式 PreferredRecordSyntax

元素集名 ElementSetName (F/B)  F — Full (MARC and OPAC records)   B — Brief(MARC records)

结果集名称 ResultSetName默认default
返回数量  PreferedEachCount

以上就是z39.50客户端的主要流程,当然里面很多细节也需要注意,比如编码 因为有外文原版图书著录,必然会涉及到小语种,所以marc编码我们采用的是UTF-8编码存储,避免产生乱码。

 

如果你想再自己的产品上加上z39.50功能,但编程能力有限,您可以购买源码我们会提供demo 源码帮助说明如何使用。必要的话进行技术指导。

本文固定链接: http://www.sjzwtrj.cn/231.html | 文图软件

该日志由 sjzwcs 于2018年05月28日发表在 开发总结 分类下, 通告目前不可用,你可以至底部留下评论。
原创文章转载请注明: C# Z39.50客户端 含全部源代码附demo演示源码 | 文图软件
关键字: , ,

C# Z39.50客户端 含全部源代码附demo演示源码:目前有815 条留言

  1. I was more than happy to discover this site. I want
    to to thank you for your time for this particularly fantastic read!!

    I definitely appreciated every part of it and I have you bookmarked to look at new information in your
    website.

    2019-09-20 上午3:15 [回复]
  2. I was wondering if you ever thought of changing the page layout of your blog?
    Its very well written; I love what youve got
    to say. But maybe you could a little more in the way
    of content so people could connect with it better. Youve got an awful lot of text for only
    having one or two pictures. Maybe you could space it out better?

    2019-09-20 上午2:16 [回复]
  3. 813楼
    홀덤 확률:

    hello there and thank you for your info – I’ve definitely picked up anything new from right here.
    I did however expertise several technical points using this web site, as I experienced to
    reload the site a lot of times previous to I
    could get it to load correctly. I had been wondering
    if your hosting is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect
    your placement in google and could damage your quality score
    if advertising and marketing with Adwords.
    Anyway I’m adding this RSS to my e-mail and could look out for much more
    of your respective fascinating content. Make sure you
    update this again very soon.

    2019-09-20 上午1:37 [回复]
  4. It is truly a great and helpful piece of info. I am satisfied that you simply
    shared this useful information with us. Please keep us informed like this.
    Thanks for sharing.

    2019-09-20 上午1:05 [回复]
  5. continuously i used to read smaller posts which also clear their motive, and that is also happening with this article which I am reading at this time.

    2019-09-20 上午12:40 [回复]

发表评论

快捷键:Ctrl+Enter