zoukankan      html  css  js  c++  java
  • MapInfo Update Feature

    程序如下:

     1   private void updateFeatureToolStripMenuItem_Click(object sender, EventArgs e)
     2        {
     3            try
     4            {
     5                MapInfo.Data.Table CNTable = MapInfo.Engine.Session.Current.Catalog.GetTable("Testworld");
     6                MapInfo.Data.SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("Country='China'");
     7                MapInfo.Data.IResultSetFeatureCollection irfc = MapInfo.Engine.Session.Current.Catalog.Search(CNTable, si);
     8                Feature ftr = irfc[0];
     9                ftr["Country"= "China";
    10               // CNTable.UpdateFeature(ftr);
    11                MIConnection conn = new MIConnection();
    12                conn.Open();
    13                MICommand cmd = conn.CreateCommand();
    14                cmd.CommandText = "update " + CNTable.Alias + " set obj=@obj,Country =@name where MI_Key =@MIKEY";
    15                cmd.Parameters.Add("@obj", ftr.Geometry);
    16                cmd.Parameters.Add("@name""中国");
    17                cmd.Parameters.Add("@MIKEY", ftr.Key);
    18                cmd.ExecuteNonQuery();
    19                
    20                //change style
    21                MapInfo.Styles.CompositeStyle cs = new MapInfo.Styles.CompositeStyle();
    22                MapInfo.Styles.BitmapPointStyle bmpStyle = new MapInfo.Styles.BitmapPointStyle();
    23                bmpStyle.Name = "YIEL2-32.BMP";
    24                bmpStyle.PointSize =28;
    25                cs.SymbolStyle = bmpStyle;            
    26            
    27            }

    28            catch (Exception ex)
    29            {
    30                MessageBox.Show(ex.ToString());
    31            }

    32        }
  • 相关阅读:
    python端口扫描
    python模块-platform
    Mysql注入root权限直接写一句话马
    meterpreter使用
    msfpayload反弹shell
    sql_injection之post注入
    初涉sqlmap
    sql_injection之基本get注入
    利用SSLStrip截获https协议--抓取邮箱等密码
    简析CSRF
  • 原文地址:https://www.cnblogs.com/abcdwxc/p/1012424.html
Copyright © 2011-2022 走看看