• 大小: 95KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: C#
  • 标签: c#  AE  

资源简介

根据网络资源自学整理,一起入门AE开发。vs2010编译,3.5框架。代码实现 基于excel生成点线面shp矢量功能。互相讨论。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

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


        OleDbConnection oledbConnection;
        private void button1_Click(object sender EventArgs e)
        {
            try
            {
                openFileDialog1.title = “打开Excel表格“;
                openFileDialog1.Filter = “Excel表格(*.xls)|*.xls|CSV格式(*.csv)|*.csv“;
                openFileDialog1.ShowDialog();
                string FileName = openFileDialog1.FileName;
                string strConn = @“Provider=Microsoft.Jet.OLEDB.4.0;Data Source=“
                    + FileName + “;Extended Properties=Excel 8.0“;
                oledbConnection = new OleDbConnection(strConn);
                oledbConnection.Open();
                DataTable table = new DataTable();
                table = oledbConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables
                    new object[] { null null null “Table“ });
                comboBox1.Items.Clear();
                foreach (DataRow dr in table.Rows)
                {
                    comboBox1.Items.Add(dr[“TABLE_NAME“].ToString());
                }
                comboBox1.Text = comboBox1.Items[0].ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button2_Click(object sender EventArgs e)
        {
            try
            {
                string sheetName = comboBox1.Text;
                string strCom = @“Select * from [“ + sheetName + “]“;
                OleDbDataAdapter Command = new OleDbDataAdapter(strCom oledbConnection);
                DataSet dataSet = new DataSet();
                Command.Fill(dataSet “[“ + sheetName + “]“);
                dataGridView1.DataMember = “[“ + sheetName + “]“;
                dataGridView1.DataSource = dataSet;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void button3_Click(object sender EventArgs e)
        {
            ZCSHP form = new ZCSHP(axMapControl1 dataGridView1);
            form.ShowDialog(this);
        }

        private void Form1_Load(object sender EventArgs e)
        {

        }

       
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      22016  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe

     文件      48640  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb

     文件      11608  2018-05-03 20:02  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe

     文件        490  2015-10-30 15:19  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest

     文件       2661  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs

     文件       7638  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs

     文件       9411  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx

     文件     124038  2018-04-25 19:05  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7731  2018-05-03 20:03  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        180  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.CreateShpFilebaseOnExcel.resources

     文件       3431  2018-05-03 20:02  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

     文件       1110  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache

     文件     127634  2018-04-25 19:57  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache

     文件      22016  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe

     文件       2385  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Form1.resources

     文件      48640  2018-05-03 19:47  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb

     文件        180  2018-04-25 19:57  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources

     文件        583  2018-04-25 19:49  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs

     文件       1380  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs

     文件       2900  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs

     文件       5612  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.resx

     文件       1111  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.Designer.cs

     文件        249  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\Properties\Settings.settings

     文件       6685  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\WindowsFormsApplication1.csproj

     文件       7629  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\ZCSHP.cs

     文件      10738  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\ZCSHP.Designer.cs

     文件       6020  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\ZCSHP.resx

     文件        914  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1.sln

    ..A..H.     46080  2018-05-03 20:07  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1.suo

     目录          0  2018-04-25 17:11  基于excel生成点线面shp矢量\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\TempPE

............此处省略13个文件信息

评论

共有 条评论