zoukankan      html  css  js  c++  java
  • C# 添加服务引用。

    1,服务引用给的实例(需要一个网址连接)

    http://192.168.17.131:12170/amtiot.gis.WCF/SpatialAnalysis.svc  (类似于这样的一个网址)

    在网络里面打开后的截图:

    2,在vs中新建一个c#工程,添加服务引用,将地址粘贴如下图点击前往后即可使用(命名空间可以根据自己的需求更改)

    添加完成后:

    3,使用代码中只有带标号的四句话是添加的。

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    using tt.ServiceReference1;                              //1
    
    namespace tt
    {
        static class Program
        {
            /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            [STAThread]
            static void Main()
            {
                SpatialAnalysisClient client = new SpatialAnalysisClient();                //2
                ServiceReference1.BoundaryInfo result = client.GetBoundaryWithSensorWidth("S535100031", "2015-06-11 13:00:00", "2015-06-11 13:35:00", false); //3
                client.Close();  //4
    
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }
    }
  • 相关阅读:
    悬线法练习
    Codechef MAY 15 Counting on a directed graph
    Codechef MAY 15 Chef and Balanced Strings
    兔子与兔子
    雪花雪花雪花
    约数之和
    分形之城
    递归实现组合型、指数型、排列型 枚举
    最短Hamilton路径
    六十四位整数乘法
  • 原文地址:https://www.cnblogs.com/lwngreat/p/4665056.html
Copyright © 2011-2022 走看看