基本信息
源码名称:调用医保dll
源码大小:15.43M
文件格式:.zip
开发语言:C#
更新时间:2024-10-06
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Xml.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Runtime.InteropServices;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (Environment.Is64BitProcess)
            {
                // 32-bit
                MessageBox.Show("64");
            }
            else
            {
                // 64-bit
                MessageBox.Show("else");
            }
            IntPtr outPut = System.Runtime.InteropServices.Marshal.AllocHGlobal(2048);
            //string url = "https://igb.hsa.gdgov.cn/prd_nation_eccode/prd_eccode/localcfc/api/hsecfc/localQrCodeQuery";
            string url = "https://dzpz.ybj.ahzwfw.gov.cn/localcfc/api/hsecfc/localQrCodeQuery";
            string res = NationEcTrans(url, sendJson(), outPut);
            string retStr = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(outPut);
            JObject result = JsonConvert.DeserializeObject<JObject>(retStr);
            string ecToken = result["data"]["ecToken"].ToString();
            //textBox4.Text = ecToken;
        }
        public static string sendJson()
        {
            var abcObject = new
            {
                data = new
                {

                    businessType = "01101",
                    deviceType = "",
                    officeId = "32760",
                    officeName = "消化内科",
                    operatorId = "test001",
                    operatorName = "超级管理员",
                    orgId = "35020319001" //医院代码
                },
                transType = "ec.query",
                orgId = "35020319001" //医院代码

            };
            string serJson = JsonConvert.SerializeObject(abcObject);
            return serJson;
        }
        [DllImport("NationECCode.dll", CallingConvention = CallingConvention.StdCall)]
        static extern string NationEcTrans(string strUrl, string InData, IntPtr outPut);

    }
}