SimuTools/App.config
@@ -1,6 +1,9 @@ <?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> </startup> </configuration> <appSettings> <add key="sizes" value="64,128,256,512,1024,2048"/> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> </startup> </configuration> SimuTools/FrmMain.Designer.cs
@@ -37,7 +37,6 @@ this.txtFlowPath = new System.Windows.Forms.TextBox(); this.lblFlow = new System.Windows.Forms.Label(); this.btnFlowPath = new System.Windows.Forms.Button(); this.tabLogs = new System.Windows.Forms.ListBox(); this.btnRun = new System.Windows.Forms.Button(); this.SuspendLayout(); // @@ -134,22 +133,11 @@ this.btnFlowPath.UseVisualStyleBackColor = true; this.btnFlowPath.Click += new System.EventHandler(this.btnFlowPath_Click); // // tabLogs // this.tabLogs.Font = new System.Drawing.Font("å®ä½", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.tabLogs.FormattingEnabled = true; this.tabLogs.ItemHeight = 16; this.tabLogs.Location = new System.Drawing.Point(27, 176); this.tabLogs.Name = "tabLogs"; this.tabLogs.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple; this.tabLogs.Size = new System.Drawing.Size(670, 340); this.tabLogs.TabIndex = 56; // // btnRun // this.btnRun.Font = new System.Drawing.Font("å®ä½", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnRun.ForeColor = System.Drawing.SystemColors.Highlight; this.btnRun.Location = new System.Drawing.Point(27, 540); this.btnRun.Location = new System.Drawing.Point(27, 172); this.btnRun.Name = "btnRun"; this.btnRun.Size = new System.Drawing.Size(670, 26); this.btnRun.TabIndex = 57; @@ -161,9 +149,8 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(735, 594); this.ClientSize = new System.Drawing.Size(735, 222); this.Controls.Add(this.btnRun); this.Controls.Add(this.tabLogs); this.Controls.Add(this.txtFlowPath); this.Controls.Add(this.lblFlow); this.Controls.Add(this.btnFlowPath); @@ -176,6 +163,7 @@ this.Name = "FrmMain"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "å æ¶ä»¿çå·¥å ·"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing); this.Load += new System.EventHandler(this.FrmMain_Load); this.ResumeLayout(false); this.PerformLayout(); @@ -193,7 +181,6 @@ private System.Windows.Forms.TextBox txtFlowPath; private System.Windows.Forms.Label lblFlow; private System.Windows.Forms.Button btnFlowPath; private System.Windows.Forms.ListBox tabLogs; private System.Windows.Forms.Button btnRun; } } SimuTools/FrmMain.cs
@@ -1,4 +1,5 @@ using System; using SimuTools.Tools; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -19,7 +20,12 @@ private void FrmMain_Load(object sender, EventArgs e) { LogOut.Info("å¯å¨ç¨åº..."); } private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { LogOut.Info("å ³éç¨åº..."); } private void btnTerrainPath_Click(object sender, EventArgs e) SimuTools/Log.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,37 @@ <?xml version="1.0" encoding="utf-8" ?> <configuration> <!--æ¥å¿é ç½®é¨å--> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> </configSections> <!--ç«ç¹æ¥å¿é ç½®é¨å--> <log4net> <root> <!-- æ¥å¿ç级ï¼ALL|DEBUG|INFO|WARN|ERROR|FATAL|OFF --> <priority value="INFO"/> <appender-ref ref="RollingFileAppender"/> </root> <appender name="TraceAppender" type="log4net.Appender.TraceAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date%newline%message"/> </layout> </appender> <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date%newline%message"/> </layout> </appender> <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="log.txt"/> <appendToFile value="true"/> <maxSizeRollBackups value="5"/> <maximumFileSize value="10MB"/> <rollingStyle value="Size"/> <staticLogFileName value="true"/> <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date%newline%message"/> </layout> </appender> </log4net> </configuration> SimuTools/Properties/Resources.Designer.cs
@@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // <auto-generated> // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬: 4.0.30319.42000 // è¿è¡æ¶çæ¬:4.0.30319.42000 // // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¸¢å¤±ã // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </auto-generated> //------------------------------------------------------------------------------ namespace SimuTools.Properties { namespace SimuTools.Properties { using System; /// <summary> /// ä¸ä¸ªå¼ºç±»åçèµæºç±»ï¼ç¨äºæ¥æ¾æ¬å°åçå符串çã /// </summary> @@ -22,48 +22,40 @@ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { internal Resources() { } /// <summary> /// è¿åæ¤ç±»ä½¿ç¨çãç¼åç ResourceManager å®ä¾ã /// è¿åæ¤ç±»ä½¿ç¨çç¼åç ResourceManager å®ä¾ã /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if ((resourceMan == null)) { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SimuTools.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// 为ææèµæºæ¥æ¾éåå½å线ç¨ç CurrentUICulture 屿§ï¼ /// æ¹æ³æ¯ä½¿ç¨æ¤å¼ºç±»åèµæºç±»ã /// ä½¿ç¨æ¤å¼ºç±»åèµæºç±»ï¼ä¸ºææèµæºæ¥æ¾ /// éåå½å线ç¨ç CurrentUICulture 屿§ã /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { set { resourceCulture = value; } } SimuTools/Properties/Settings.Designer.cs
@@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // æ¤ä»£ç ç±å·¥å ·çæã // è¿è¡æ¶çæ¬:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // å¯¹æ¤æä»¶çæ´æ¹å¯è½ä¼å¯¼è´ä¸æ£ç¡®çè¡ä¸ºï¼å¹¶ä¸å¦æ // éæ°çæä»£ç ï¼è¿äºæ´æ¹å°ä¼ä¸¢å¤±ã // </auto-generated> //------------------------------------------------------------------------------ namespace SimuTools.Properties { namespace SimuTools.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { public static Settings Default { get { return defaultInstance; } } SimuTools/SimuTools.csproj
@@ -9,8 +9,9 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>SimuTools</RootNamespace> <AssemblyName>SimuTools</AssemblyName> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -32,6 +33,10 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="log4net4, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>dlls\log4net4.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> @@ -52,6 +57,7 @@ </Compile> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Tools\LogOut.cs" /> <EmbeddedResource Include="FrmMain.resx"> <DependentUpon>FrmMain.cs</DependentUpon> </EmbeddedResource> @@ -63,7 +69,11 @@ <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> <DesignTime>True</DesignTime> </Compile> <EmbeddedResource Include="Log.config"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </EmbeddedResource> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> @@ -77,6 +87,20 @@ <ItemGroup> <None Include="App.config" /> </ItemGroup> <ItemGroup> <Content Include="dlls\gdalconst_csharp.dll" /> <Content Include="dlls\gdalconst_wrap.dll" /> <Content Include="dlls\gdal_csharp.dll" /> <Content Include="dlls\gdal_wrap.dll" /> <Content Include="dlls\log4net4.dll" /> <Content Include="dlls\ogr_csharp.dll" /> <Content Include="dlls\ogr_wrap.dll" /> <Content Include="dlls\osr_csharp.dll" /> <Content Include="dlls\osr_wrap.dll" /> </ItemGroup> <ItemGroup> <Folder Include="Domain\" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. SimuTools/Tools/LogOut.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,132 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace SimuTools.Tools { /// <summary> /// æ¥å¿è¾åºç±» /// </summary> public class LogOut { /// <summary> /// æ¥å¿ /// </summary> protected static readonly log4net.ILog _log; /// <summary> /// éææé 彿° /// </summary> static LogOut() { try { _log = log4net.LogManager.GetLogger("log4net"); //HttpContext.Current.Request.PhysicalApplicationPath //string fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\Log.config"); //string fileName = Path.Combine(Application.StartupPath, "Log.config"); string fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Log.config"); log4net.Config.XmlConfigurator.Configure(new FileInfo(fileName)); } catch { } } /// <summary> /// è°è¯ /// </summary> /// <param name="message">æ¥å¿</param> public static void Debug(string message) { try { if (_log.IsDebugEnabled) { _log.Debug("è°è¯ï¼" + message + "\r\n\r\n"); } } catch { } } /// <summary> /// ä¿¡æ¯ /// </summary> /// <param name="message">æ¥å¿</param> public static void Info(string message) { try { if (_log.IsInfoEnabled) { _log.Info("ä¿¡æ¯ï¼" + message + "\r\n\r\n"); } } catch { } } /// <summary> /// è¦å /// </summary> /// <param name="message">æ¥å¿</param> public static void Warn(string message) { try { if (_log.IsWarnEnabled) { _log.Warn("è¦åï¼" + message + "\r\n\r\n"); } } catch { } } /// <summary> /// é误 /// </summary> /// <param name="message">æ¥å¿</param> public static void Error(string message) { try { if (_log.IsErrorEnabled) { _log.Error("é误ï¼" + message + "\r\n\r\n"); } } catch { } } /// <summary> /// è´å½ /// </summary> /// <param name="message">æ¥å¿</param> public static void Fatal(string message) { try { if (_log.IsFatalEnabled) { _log.Fatal("è´å½ï¼" + message + "\r\n\r\n"); } } catch { } } } } SimuTools/dlls/gdal_csharp.dllBinary files differ
SimuTools/dlls/gdal_wrap.dllBinary files differ
SimuTools/dlls/gdalconst_csharp.dllBinary files differ
SimuTools/dlls/gdalconst_wrap.dllBinary files differ
SimuTools/dlls/log4net4.dllBinary files differ
SimuTools/dlls/ogr_csharp.dllBinary files differ
SimuTools/dlls/ogr_wrap.dllBinary files differ
SimuTools/dlls/osr_csharp.dllBinary files differ
SimuTools/dlls/osr_wrap.dllBinary files differ