@@ -0,0 +1,3 @@ | |||||
bin/ | |||||
obj/ | |||||
packages/ |
@@ -0,0 +1,25 @@ | |||||
| |||||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||||
# Visual Studio 15 | |||||
VisualStudioVersion = 15.0.26730.12 | |||||
MinimumVisualStudioVersion = 10.0.40219.1 | |||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GPSConvert", "GPSConvert\GPSConvert.csproj", "{04279795-9EE5-4D5F-919D-F691800BACE1}" | |||||
EndProject | |||||
Global | |||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||||
Debug|Any CPU = Debug|Any CPU | |||||
Release|Any CPU = Release|Any CPU | |||||
EndGlobalSection | |||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||||
{04279795-9EE5-4D5F-919D-F691800BACE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
{04279795-9EE5-4D5F-919D-F691800BACE1}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
{04279795-9EE5-4D5F-919D-F691800BACE1}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
{04279795-9EE5-4D5F-919D-F691800BACE1}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
EndGlobalSection | |||||
GlobalSection(SolutionProperties) = preSolution | |||||
HideSolutionNode = FALSE | |||||
EndGlobalSection | |||||
GlobalSection(ExtensibilityGlobals) = postSolution | |||||
SolutionGuid = {52A57F2C-C03E-484D-B2F8-4DD9F53E5A35} | |||||
EndGlobalSection | |||||
EndGlobal |
@@ -0,0 +1 @@ | |||||
<%@ WebHandler Language="C#" CodeBehind="GPSConvert.ashx.cs" Class="GPSConvert.GPSConvert" %> |
@@ -0,0 +1,268 @@ | |||||
using Newtonsoft.Json; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Web; | |||||
namespace GPSConvert | |||||
{ | |||||
/// <summary> | |||||
/// GPSConvert 的摘要说明 | |||||
/// </summary> | |||||
public class GPSConvert : IHttpHandler | |||||
{ | |||||
public void ProcessRequest(HttpContext context) | |||||
{ | |||||
//DFMGps g = new DFMGps() { lng = "104.03.40.95", lat = "30.39.46.04" }; | |||||
//Gps g = new Gps() { lng = 104.0613755710, lat = 30.6627876858 };//谷歌地球 | |||||
//Gps g = new Gps() { lng = 104.0638732910, lat = 30.660359565 };//腾讯高德 | |||||
//Gps g = new Gps() { lng = 104.0703438917, lat = 30.6664848935 };//百度 | |||||
Gps g = new Gps(); | |||||
GpsConvert gs; | |||||
int _gt = 0; | |||||
//0:谷歌地球,1:腾讯高德,2:百度 | |||||
if (int.TryParse(context.Request["t"], out _gt)) | |||||
; | |||||
try | |||||
{ | |||||
string[] _g = context.Request["g"].Split(','); | |||||
if (double.TryParse(_g[0], out g.lng) && double.TryParse(_g[1], out g.lat)) | |||||
gs = new GpsConvert(g, (GpsType)_gt); | |||||
else | |||||
gs = new GpsConvert(new DFMGps() { lng = _g[0], lat = _g[1] }); | |||||
context.Response.ContentType = "text/plain"; | |||||
context.Response.Write(JsonConvert.SerializeObject(gs)); | |||||
context.Response.End(); | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
throw new Exception("invaild parameter"); | |||||
} | |||||
} | |||||
public bool IsReusable | |||||
{ | |||||
get | |||||
{ | |||||
return false; | |||||
} | |||||
} | |||||
//WGS-84,GCJ-02,BD-09 | |||||
public class Gps | |||||
{ | |||||
public double lng;//经度 | |||||
public double lat;//纬度 | |||||
} | |||||
//度分秒格式坐标 | |||||
public class DFMGps | |||||
{ | |||||
public string lng;//经度 | |||||
public string lat;//纬度 | |||||
} | |||||
public enum GpsType | |||||
{ | |||||
Wgs84 = 0, | |||||
Gcj02 = 1, | |||||
Bd09 = 2 | |||||
}; | |||||
public class GpsConvert | |||||
{ | |||||
public DFMGps _dfm = new DFMGps(); //度分秒坐标 | |||||
public Gps Wgs84 = new Gps(); //WGS-84 | |||||
public Gps Gcj02 = new Gps();//GCJ-02 中国坐标偏移标准 Google Map、高德、腾讯使用 | |||||
public Gps Bd09 = new Gps();//BD-09 百度坐标偏移标准,Baidu Map使用 | |||||
private double PI = Math.PI; | |||||
private double xPI = Math.PI * 3000.0 / 180.0; | |||||
public GpsConvert(DFMGps _v) | |||||
{ | |||||
_dfm = _v; | |||||
DfmToWgs84(); | |||||
Wgs84ToGcj02(); | |||||
Gcj02ToBd09(); | |||||
} | |||||
public GpsConvert(Gps _v, GpsType type) | |||||
{ | |||||
if (type == GpsType.Wgs84) | |||||
{ | |||||
Wgs84 = _v; | |||||
Wgs84ToDfm(); | |||||
Wgs84ToGcj02(); | |||||
Gcj02ToBd09(); | |||||
} | |||||
else if (type == GpsType.Gcj02) | |||||
{ | |||||
Gcj02 = _v; | |||||
Gcj02ToWgs84(); | |||||
Wgs84ToDfm(); | |||||
Gcj02ToBd09(); | |||||
} | |||||
else if (type == GpsType.Bd09) | |||||
{ | |||||
Bd09 = _v; | |||||
Bd09ToGcj02(); | |||||
Gcj02ToWgs84(); | |||||
Wgs84ToDfm(); | |||||
} | |||||
} | |||||
private Gps delta(Gps t) | |||||
{ | |||||
var a = 6378245.0; // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。 | |||||
var ee = 0.00669342162296594323; // ee: 椭球的偏心率。 | |||||
var dLat = this.transformLat(t.lng - 105.0, t.lat - 35.0); | |||||
var dLng = this.transformLng(t.lng - 105.0, t.lat - 35.0); | |||||
var radLat = t.lat / 180.0 * PI; | |||||
var magic = Math.Sin(radLat); | |||||
magic = 1 - ee * magic * magic; | |||||
var sqrtMagic = Math.Sqrt(magic); | |||||
return new Gps() { lat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * PI), lng = (dLng * 180.0) / (a / sqrtMagic * Math.Cos(radLat) * PI) }; | |||||
} | |||||
//WGS-84 to GCJ-02 | |||||
private void Wgs84ToGcj02() | |||||
{ | |||||
if (Wgs84 == null || this.outOfChina(Wgs84)) | |||||
Gcj02 = Wgs84; | |||||
var t = this.delta(Wgs84); | |||||
Gcj02.lng = t.lng + Wgs84.lng; | |||||
Gcj02.lat = t.lat + Wgs84.lat; | |||||
} | |||||
//GCJ-02 to WGS-84 | |||||
private void Gcj02ToWgs84() | |||||
{ | |||||
if (Gcj02 == null || this.outOfChina(Gcj02)) | |||||
Wgs84 = Gcj02; | |||||
var t = this.delta(Gcj02); | |||||
Wgs84.lng = Gcj02.lng - t.lng; | |||||
Wgs84.lat = Gcj02.lat - t.lat; | |||||
} | |||||
//GCJ-02 to BD-09 | |||||
private void Gcj02ToBd09() | |||||
{ | |||||
double x = Gcj02.lng; | |||||
double y = Gcj02.lat; | |||||
double z = Math.Sqrt(x * x + y * y) + 0.00002 * Math.Sin(y * xPI); | |||||
double theta = Math.Atan2(y, x) + 0.000003 * Math.Cos(x * xPI); | |||||
Bd09.lng = z * Math.Cos(theta) + 0.0065; | |||||
Bd09.lat = z * Math.Sin(theta) + 0.006; | |||||
} | |||||
//BD-09 to GCJ-02 | |||||
private void Bd09ToGcj02() | |||||
{ | |||||
double x = Bd09.lng - 0.0065; | |||||
double y = Bd09.lat - 0.006; | |||||
double z = Math.Sqrt(x * x + y * y) - 0.00002 * Math.Sin(y * xPI); | |||||
double theta = Math.Atan2(y, x) - 0.000003 * Math.Cos(x * xPI); | |||||
Gcj02.lng = z * Math.Cos(theta); | |||||
Gcj02.lat = z * Math.Sin(theta); | |||||
} | |||||
//WGS-84 to 度分秒坐标 | |||||
private void Wgs84ToDfm() | |||||
{ | |||||
_dfm.lng = TranDegreeToDMs(Wgs84.lng); | |||||
_dfm.lat = TranDegreeToDMs(Wgs84.lat); | |||||
} | |||||
//度分秒坐标 to WGS-84 | |||||
private void DfmToWgs84() | |||||
{ | |||||
Wgs84.lng = TranDMsToDegree(_dfm.lng); | |||||
Wgs84.lat = TranDMsToDegree(_dfm.lat); | |||||
} | |||||
private double TranDMsToDegree(string _dms) | |||||
{ | |||||
string[] dms = _dms.Split('.'); | |||||
if (dms.Length == 4) | |||||
return double.Parse(dms[0]) + double.Parse(dms[1]) / 60 + double.Parse(dms[2] + "." + dms[3] ?? "0") / 3600; | |||||
else if (dms.Length == 3) | |||||
return double.Parse(dms[0]) + double.Parse(dms[1]) / 60 + double.Parse(dms[2]) / 3600; | |||||
else if (dms.Length == 2) | |||||
return double.Parse(_dms); | |||||
else | |||||
return 0d; | |||||
} | |||||
private static string TranDegreeToDMs(double d) | |||||
{ | |||||
int Degree = Convert.ToInt16(Math.Truncate(d));//度 | |||||
d = d - Degree; | |||||
int M = Convert.ToInt16(Math.Truncate((d) * 60));//分 | |||||
int S = Convert.ToInt16(Math.Round((d * 60 - M) * 60)); | |||||
if (S == 60) | |||||
{ | |||||
M = M + 1; | |||||
S = 0; | |||||
} | |||||
if (M == 60) | |||||
{ | |||||
M = 0; | |||||
Degree = Degree + 1; | |||||
} | |||||
string rstr = Degree.ToString() + "."; | |||||
if (M < 10) | |||||
rstr = rstr + "0" + M.ToString(); | |||||
else | |||||
rstr = rstr + M.ToString(); | |||||
if (S < 10) | |||||
rstr = rstr + "0" + S.ToString(); | |||||
else | |||||
rstr = rstr + S.ToString(); | |||||
return rstr; | |||||
} | |||||
private bool outOfChina(Gps _t) | |||||
{ | |||||
if (_t.lng < 72.004 || _t.lng > 137.8347) | |||||
return true; | |||||
if (_t.lat < 0.8293 || _t.lat > 55.8271) | |||||
return true; | |||||
return false; | |||||
} | |||||
private double transformLat(double x, double y) | |||||
{ | |||||
double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.Sqrt(Math.Abs(x)); | |||||
ret += (20.0 * Math.Sin(6.0 * x * PI) + 20.0 * Math.Sin(2.0 * x * PI)) * 2.0 / 3.0; | |||||
ret += (20.0 * Math.Sin(y * PI) + 40.0 * Math.Sin(y / 3.0 * PI)) * 2.0 / 3.0; | |||||
ret += (160.0 * Math.Sin(y / 12.0 * PI) + 320 * Math.Sin(y * PI / 30.0)) * 2.0 / 3.0; | |||||
return ret; | |||||
} | |||||
private double transformLng(double x, double y) | |||||
{ | |||||
double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.Sqrt(Math.Abs(x)); | |||||
ret += (20.0 * Math.Sin(6.0 * x * PI) + 20.0 * Math.Sin(2.0 * x * PI)) * 2.0 / 3.0; | |||||
ret += (20.0 * Math.Sin(x * PI) + 40.0 * Math.Sin(x / 3.0 * PI)) * 2.0 / 3.0; | |||||
ret += (150.0 * Math.Sin(x / 12.0 * PI) + 300.0 * Math.Sin(x / 30.0 * PI)) * 2.0 / 3.0; | |||||
return ret; | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,130 @@ | |||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" /> | |||||
<Import Project="..\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props')" /> | |||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||||
<PropertyGroup> | |||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||||
<ProductVersion> | |||||
</ProductVersion> | |||||
<SchemaVersion>2.0</SchemaVersion> | |||||
<ProjectGuid>{04279795-9EE5-4D5F-919D-F691800BACE1}</ProjectGuid> | |||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> | |||||
<OutputType>Library</OutputType> | |||||
<AppDesignerFolder>Properties</AppDesignerFolder> | |||||
<RootNamespace>GPSConvert</RootNamespace> | |||||
<AssemblyName>GPSConvert</AssemblyName> | |||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | |||||
<UseIISExpress>true</UseIISExpress> | |||||
<Use64BitIISExpress /> | |||||
<IISExpressSSLPort /> | |||||
<IISExpressAnonymousAuthentication /> | |||||
<IISExpressWindowsAuthentication /> | |||||
<IISExpressUseClassicPipelineMode /> | |||||
<UseGlobalApplicationHostFile /> | |||||
<NuGetPackageImportStamp> | |||||
</NuGetPackageImportStamp> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||||
<DebugSymbols>true</DebugSymbols> | |||||
<DebugType>full</DebugType> | |||||
<Optimize>false</Optimize> | |||||
<OutputPath>bin\</OutputPath> | |||||
<DefineConstants>DEBUG;TRACE</DefineConstants> | |||||
<ErrorReport>prompt</ErrorReport> | |||||
<WarningLevel>4</WarningLevel> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||||
<DebugSymbols>true</DebugSymbols> | |||||
<DebugType>pdbonly</DebugType> | |||||
<Optimize>true</Optimize> | |||||
<OutputPath>bin\</OutputPath> | |||||
<DefineConstants>TRACE</DefineConstants> | |||||
<ErrorReport>prompt</ErrorReport> | |||||
<WarningLevel>4</WarningLevel> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.CSharp" /> | |||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | |||||
<SpecificVersion>False</SpecificVersion> | |||||
<HintPath>..\..\NGAReptile\jfwang.NGAReptile\bin\Debug\Newtonsoft.Json.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="System.Web.DynamicData" /> | |||||
<Reference Include="System.Web.Entity" /> | |||||
<Reference Include="System.Web.ApplicationServices" /> | |||||
<Reference Include="System.ComponentModel.DataAnnotations" /> | |||||
<Reference Include="System" /> | |||||
<Reference Include="System.Data" /> | |||||
<Reference Include="System.Core" /> | |||||
<Reference Include="System.Data.DataSetExtensions" /> | |||||
<Reference Include="System.Web.Extensions" /> | |||||
<Reference Include="System.Xml.Linq" /> | |||||
<Reference Include="System.Drawing" /> | |||||
<Reference Include="System.Web" /> | |||||
<Reference Include="System.Xml" /> | |||||
<Reference Include="System.Configuration" /> | |||||
<Reference Include="System.Web.Services" /> | |||||
<Reference Include="System.EnterpriseServices" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Content Include="GPSConvert.ashx" /> | |||||
<None Include="packages.config" /> | |||||
<None Include="Web.Debug.config"> | |||||
<DependentUpon>Web.config</DependentUpon> | |||||
</None> | |||||
<None Include="Web.Release.config"> | |||||
<DependentUpon>Web.config</DependentUpon> | |||||
</None> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Content Include="Web.config" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Compile Include="GPSConvert.ashx.cs"> | |||||
<DependentUpon>GPSConvert.ashx</DependentUpon> | |||||
</Compile> | |||||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||||
</ItemGroup> | |||||
<PropertyGroup> | |||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | |||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | |||||
</PropertyGroup> | |||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | |||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> | |||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> | |||||
<ProjectExtensions> | |||||
<VisualStudio> | |||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | |||||
<WebProjectProperties> | |||||
<UseIIS>True</UseIIS> | |||||
<AutoAssignPort>True</AutoAssignPort> | |||||
<DevelopmentServerPort>60977</DevelopmentServerPort> | |||||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | |||||
<IISUrl>http://localhost:60977/</IISUrl> | |||||
<NTLMAuthentication>False</NTLMAuthentication> | |||||
<UseCustomServer>False</UseCustomServer> | |||||
<CustomServerUrl> | |||||
</CustomServerUrl> | |||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> | |||||
</WebProjectProperties> | |||||
</FlavorProperties> | |||||
</VisualStudio> | |||||
</ProjectExtensions> | |||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | |||||
<PropertyGroup> | |||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText> | |||||
</PropertyGroup> | |||||
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props'))" /> | |||||
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.5\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" /> | |||||
</Target> | |||||
<!-- 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. | |||||
<Target Name="BeforeBuild"> | |||||
</Target> | |||||
<Target Name="AfterBuild"> | |||||
</Target> | |||||
--> | |||||
</Project> |
@@ -0,0 +1,37 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
<PropertyGroup> | |||||
<UseIISExpress>true</UseIISExpress> | |||||
<Use64BitIISExpress /> | |||||
<IISExpressSSLPort /> | |||||
<IISExpressAnonymousAuthentication /> | |||||
<IISExpressWindowsAuthentication /> | |||||
<IISExpressUseClassicPipelineMode /> | |||||
<UseGlobalApplicationHostFile /> | |||||
</PropertyGroup> | |||||
<ProjectExtensions> | |||||
<VisualStudio> | |||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | |||||
<WebProjectProperties> | |||||
<StartPageUrl> | |||||
</StartPageUrl> | |||||
<StartAction>CurrentPage</StartAction> | |||||
<AspNetDebugging>True</AspNetDebugging> | |||||
<SilverlightDebugging>False</SilverlightDebugging> | |||||
<NativeDebugging>False</NativeDebugging> | |||||
<SQLDebugging>False</SQLDebugging> | |||||
<ExternalProgram> | |||||
</ExternalProgram> | |||||
<StartExternalURL> | |||||
</StartExternalURL> | |||||
<StartCmdLineArguments> | |||||
</StartCmdLineArguments> | |||||
<StartWorkingDirectory> | |||||
</StartWorkingDirectory> | |||||
<EnableENC>True</EnableENC> | |||||
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug> | |||||
</WebProjectProperties> | |||||
</FlavorProperties> | |||||
</VisualStudio> | |||||
</ProjectExtensions> | |||||
</Project> |
@@ -0,0 +1,35 @@ | |||||
using System.Reflection; | |||||
using System.Runtime.CompilerServices; | |||||
using System.Runtime.InteropServices; | |||||
// 有关程序集的常规信息通过下列特性集 | |||||
// 控制。更改这些特性值可修改 | |||||
// 与程序集关联的信息。 | |||||
[assembly: AssemblyTitle("GPSConvert")] | |||||
[assembly: AssemblyDescription("")] | |||||
[assembly: AssemblyConfiguration("")] | |||||
[assembly: AssemblyCompany("")] | |||||
[assembly: AssemblyProduct("GPSConvert")] | |||||
[assembly: AssemblyCopyright("Copyright © 2018")] | |||||
[assembly: AssemblyTrademark("")] | |||||
[assembly: AssemblyCulture("")] | |||||
// 将 ComVisible 设置为 false 会使此程序集中的类型 | |||||
// 对 COM 组件不可见。如果需要 | |||||
// 从 COM 访问此程序集中的某个类型,请针对该类型将 ComVisible 特性设置为 true。 | |||||
[assembly: ComVisible(false)] | |||||
// 如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID | |||||
[assembly: Guid("04279795-9ee5-4d5f-919d-f691800bace1")] | |||||
// 程序集的版本信息由下列四个值组成: | |||||
// | |||||
// 主版本 | |||||
// 次版本 | |||||
// 内部版本号 | |||||
// 修订版本 | |||||
// | |||||
// 可以指定所有值,也可以使用“修订号”和“内部版本号”的默认值, | |||||
// 方法是按如下所示使用 "*": | |||||
[assembly: AssemblyVersion("1.0.0.0")] | |||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
@@ -0,0 +1,31 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<!-- 有关使用 web.config 转换的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=125889 --> | |||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |||||
<!-- | |||||
在下例中,“SetAttributes”转换将更改 | |||||
“connectionString”的值,以仅在“Match”定位器 | |||||
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。 | |||||
<connectionStrings> | |||||
<add name="MyDB" | |||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" | |||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | |||||
</connectionStrings> | |||||
--> | |||||
<system.web> | |||||
<!-- | |||||
在下例中,“Replace”转换将替换 | |||||
web.config 文件的整个 <customErrors> 节。 | |||||
请注意,由于 | |||||
在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。 | |||||
<customErrors defaultRedirect="GenericError.htm" | |||||
mode="RemoteOnly" xdt:Transform="Replace"> | |||||
<error statusCode="500" redirect="InternalError.htm"/> | |||||
</customErrors> | |||||
--> | |||||
</system.web> | |||||
</configuration> |
@@ -0,0 +1,32 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<!-- 有关使用 web.config 转换的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=125889 --> | |||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |||||
<!-- | |||||
在下例中,“SetAttributes”转换将更改 | |||||
“connectionString”的值,以仅在“Match”定位器 | |||||
找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。 | |||||
<connectionStrings> | |||||
<add name="MyDB" | |||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" | |||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | |||||
</connectionStrings> | |||||
--> | |||||
<system.web> | |||||
<compilation xdt:Transform="RemoveAttributes(debug)" /> | |||||
<!-- | |||||
在下例中,“Replace”转换将替换 | |||||
web.config 文件的整个 <customErrors> 节。 | |||||
请注意,由于 | |||||
在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。 | |||||
<customErrors defaultRedirect="GenericError.htm" | |||||
mode="RemoteOnly" xdt:Transform="Replace"> | |||||
<error statusCode="500" redirect="InternalError.htm"/> | |||||
</customErrors> | |||||
--> | |||||
</system.web> | |||||
</configuration> |
@@ -0,0 +1,21 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<!-- | |||||
有关如何配置 ASP.NET 应用程序的详细信息,请访问 | |||||
https://go.microsoft.com/fwlink/?LinkId=169433 | |||||
--> | |||||
<configuration> | |||||
<system.web> | |||||
<compilation debug="true" targetFramework="4.6.1"/> | |||||
<httpRuntime targetFramework="4.6.1"/> | |||||
</system.web> | |||||
<system.codedom> | |||||
<compilers> | |||||
<compiler language="c#;cs;csharp" extension=".cs" | |||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" | |||||
warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/> | |||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" | |||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" | |||||
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/> | |||||
</compilers> | |||||
</system.codedom> | |||||
</configuration> |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<packages> | |||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.5" targetFramework="net461" /> | |||||
<package id="Microsoft.Net.Compilers" version="2.1.0" targetFramework="net461" developmentDependency="true" /> | |||||
</packages> |