易截截图软件、单文件、免安装、纯绿色、仅160KB

ArcEngine 图例C#源码:

private void MakeLegend(IActiveView activeView,IPageLayout pageLayout)
      {
          //定义图例UID对象
          UID uid = new UIDClass();
          uid.Value="esriCore.Legend";       
          //设置图例存放的坐标位置                
          //定义单位
          pageLayout.Page.Units = esriUnits.esriCentimeters;
          //得到草图容器对象
          IGraphicsContainer container = pageLayout as IGraphicsContainer;
          //得到当前地图的框架
          IMapFrame frameElement = container.FindFrame(activeView.FocusMap) as IMapFrame;
          IElement mapElement = frameElement as IElement;
 
          IEnvelope mapEnv = mapElement.Geometry.Envelope;   
          IEnvelope envelope = new EnvelopeClass();
          //通过当前地图框架得到相对位置
          envelope.PutCoords(mapEnv.XMin, mapEnv.YMin, mapEnv.XMin + 6.5, mapEnv.YMin + 0.8);
          IMapSurroundFrame frame = frameElement.CreateSurroundFrame(uid, null);            
          ILegend legend = frame.MapSurroun


相关文档:

c#xml的增删改查


已知有一个XML文件(bookstore.xml)如下:  
  <?xml   version="1.0"   encoding="gb2312"?>  
  <bookstore>  
      <book   genre="fantasy"   ISBN="2-3631-4">  
       &n ......

C# Active控件,并触发javascript事件

创建一个Winform用户控件 UserControl1
 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
namespace MyActiveT ......

C# 格式化输出XML

很多时候有一个xml字符串,没有换行,没有缩进,要生成xml文件不易阅读。下面的代码就是怎么将一个连续的xml字符串格式化输出
// a demo string
string xml = "<Root><Eles><Ele>abc</Ele><Ele>123</Ele></Eles></Root>";
System.Xml.XmlDocument doc = new System.Xml ......

ASP.NET(C#)常用代码30例

1. 打开新的窗口并传送参数:
  传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
  接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
  2.为按钮添加对话框
Button1 ......

C#使用SQLDMO实现对MSSQL数据库进行备份和恢复

public sealed class DbOper
{
     ///<summary>
     /// DbOper类的构造函数
     ///</summary>
     private DbOper()
     {
     }
     ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号