資源簡介
將使用.net core 2.2構建一個Angular 7應用程序---實現全球天氣,它允許用戶選擇他們的位置并顯示當前的天氣

代碼片段和文件信息
using?System;
namespace?GlobalWeather
{
????internal?class?CurrentDirectoryHelpers
????{
????????internal?const?string?AspNetCoreModuleDll?=?“aspnetcorev2_inprocess.dll“;
????????[System.Runtime.InteropServices.DllImport(“kernel32.dll“)]
????????private?static?extern?IntPtr?GetModuleHandle(string?lpModuleName);
????????[System.Runtime.InteropServices.DllImport(AspNetCoreModuleDll)]
????????private?static?extern?int?http_get_application_properties(ref?IISConfigurationData?iiConfigData);
????????[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
????????private?struct?IISConfigurationData
????????{
????????????public?IntPtr?pNativeApplication;
????????????[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
????????????public?string?pwzFullApplicationPath;
????????????[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)]
????????????public?string?pwzVirtualApplicationPath;
????????????public?bool?fWindowsAuthEnabled;
????????????public?bool?fBasicAuthEnabled;
????????????public?bool?fAnonymousAuthEnable;
????????}
????????public?static?void?SetCurrentDirectory()
????????{
????????????try
????????????{
????????????????//?Check?if?physical?path?was?provided?by?ANCM
????????????????var?sitePhysicalPath?=?Environment.GetEnvironmentVariable(“ASPNETCORE_IIS_PHYSICAL_PATH“);
????????????????if?(string.IsNullOrEmpty(sitePhysicalPath))
????????????????{
????????????????????//?Skip?if?not?running?ANCM?InProcess
????????????????????if?(GetModuleHandle(AspNetCoreModuleDll)?==?IntPtr.Zero)
????????????????????{
????????????????????????return;
????????????????????}
????????????????????IISConfigurationData?configurationData?=?default(IISConfigurationData);
????????????????????if?(http_get_application_properties(ref?configurationData)?!=?0)
????????????????????{
????????????????????????return;
????????????????????}
????????????????????sitePhysicalPath?=?configurationData.pwzFullApplicationPath;
????????????????}
????????????????Environment.CurrentDirectory?=?sitePhysicalPath;
????????????}
????????????catch
????????????{
????????????????//?ignore
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-01-17?20:15??GlobalWeather\
?????目錄???????????0??2019-01-17?20:16??GlobalWeather\GlobalWeather\
?????文件????????1279??2018-12-20?11:47??GlobalWeather\GlobalWeather.sln
?????文件?????????146??2018-12-20?10:59??GlobalWeather\GlobalWeather\appsettings.Development.json
?????文件?????????105??2018-12-20?10:59??GlobalWeather\GlobalWeather\appsettings.json
?????目錄???????????0??2019-01-15?19:27??GlobalWeather\GlobalWeather\Controllers\
?????文件????????1024??2018-12-20?10:59??GlobalWeather\GlobalWeather\Controllers\ValuesController.cs
?????文件????????2295??2018-12-20?11:47??GlobalWeather\GlobalWeather\CurrentDirectoryHelpers.cs
?????文件?????????568??2018-12-24?15:22??GlobalWeather\GlobalWeather\GlobalWeather.csproj
?????文件?????????635??2018-12-20?10:59??GlobalWeather\GlobalWeather\Program.cs
?????目錄???????????0??2019-01-15?19:27??GlobalWeather\GlobalWeather\Properties\
?????文件?????????752??2018-12-20?11:34??GlobalWeather\GlobalWeather\Properties\launchSettings.json
?????文件????????1960??2019-01-15?08:20??GlobalWeather\GlobalWeather\Startup.cs
?????目錄???????????0??2019-01-17?20:34??GlobalWeather\GlobalWeather\WeatherClient\
?????文件?????????246??2018-12-20?11:01??GlobalWeather\GlobalWeather\WeatherClient\.editorconfig
?????文件????????3832??2018-12-20?13:48??GlobalWeather\GlobalWeather\WeatherClient\angular.json
?????目錄???????????0??2019-01-15?19:28??GlobalWeather\GlobalWeather\WeatherClient\dist\
?????目錄???????????0??2019-01-15?19:28??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\
?????目錄???????????0??2019-01-15?19:28??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\e2e\
?????目錄???????????0??2019-01-15?19:28??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\e2e\src\
?????文件?????????384??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\e2e\src\app.e2e-spec.js
?????文件?????????461??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\e2e\src\app.e2e-spec.js.map
?????文件?????????422??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\e2e\src\app.po.js
?????文件?????????401??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\e2e\src\app.po.js.map
?????目錄???????????0??2019-01-15?19:28??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\
?????目錄???????????0??2019-01-15?19:28??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\app\
?????文件?????????731??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\app\app-routing.module.js
?????文件?????????630??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\app\app-routing.module.js.map
?????文件?????????535??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\app\app.component.js
?????文件?????????383??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\app\app.component.js.map
?????文件????????1311??2019-01-10?07:56??GlobalWeather\GlobalWeather\WeatherClient\dist\out-tsc\src\app\app.component.spec.js
............此處省略150個文件信息
- 上一篇:企業人事管理系統源代碼,可直接使用
- 下一篇:hibernate級聯增刪改查
評論
共有 條評論