📄 program.cs
字号:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;
using System.IO;
//using System.Reflection;
namespace EngineScene
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>z
[STAThread]
static void Main()
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new MainForm());
IAoInitialize m_pAoInitialize = new AoInitializeClass();
m_pAoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB);
ClsLinkAttDataBase link = new ClsLinkAttDataBase();
String date = DateTime.Now.ToString().Substring(0, 4) + link.Getyeardate();
String directorypath = Application.StartupPath+"\\"+date+"dzm.log";
if (!System.IO.File.Exists(directorypath))
{
System.IO.FileStream file = System.IO.File.Create(directorypath);
file.Close();
}
//FileInfo f = new FileInfo(directorypath);
StreamWriter w = System.IO.File.AppendText(directorypath);
w.WriteLine(DateTime.Now.ToString() + " 程序开始执行...");
w.Flush();
//Console.WriteLine(DateTime.Now.ToString() + " 程序开始执行...");
String mondate = link.Getmondate();
String yeardate = link.Getyeardate();
double[] height = new double[] { 10, 30, 50, 70, 100 };
for (int i = 0; i < 5; i++)
{
link.CreateDay(height[i], "ws",w);
link.CreateDay(height[i], "wsmax",w);
link.CreateDay(height[i], "wpowerdensity",w);
if (mondate=="01")
{
link.CreateMonth(height[i], "ws",w);
link.CreateMonth(height[i], "wsmax",w);
link.CreateMonth(height[i], "wpowerdensity",w);
}
if (yeardate=="0101")
{
link.CreateYear(height[i], "ws",w);
link.CreateYear(height[i], "wsmax",w);
link.CreateYear(height[i], "wpowerdensity",w);
}
}
//f = null;
link = null;
m_pAoInitialize.Shutdown();
m_pAoInitialize = null;
w.WriteLine(DateTime.Now.ToString() + "等值面图片生成完成!");
w.Flush();
w.Close();
w.Dispose();
////Console.WriteLine(DateTime.Now.ToString() + "等值面图片生成完成!");
Environment.Exit(0);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -