资源简介
将使用.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级联增删改查
相关资源
- Microsoft Forms 2.0107770
- radmin3.5.2.1完美破解版(支持win10)8
- S7-300全套模块接线图
- Remote Desktop Organizer v1.4.7 支持win10
- 最新的北京地铁shp文件75146
- PNG加密解密工具73383
- vspd7.2.308.zip
- E4A无障碍跨程序操作类库(带源码、
- 软考数据库系统工程师复习资料(完
- 登录注册界面.zip48872
- stm32f407上的两个can发送和接收例程
- ddos压力测试工具99657
- 04741计算机网络原理知识点整理.docx(
- 程序员专用字体YaHei.Consolas.1.11b42517
- IEEE754 浮点转换工具
- 基于FPGA的sdi视频传输工程(k7_sdi_rx
- 恒压力供水(DBW-DQ-1.s7p)
- 联想H61主板BIOS升级F9KT58AUS支持22NM.i
- IAR For ARM 7.3最新注册机
- IAR7.20H破解机注册机
- IAR ARM 7.8破解
- IAR 7.80.4的安装包
- IAR for MSP430 v7.10.1 注册机
- XE7UP1Kg13_Unis.exe
- IAR 7.3 注册机
- IAR for ARM 7.40 破解
- IAR For ARM 7.4 破解
- CCS5.05.1可使用的license
- USB.Over.Network.Server 注册机
- 联想y470无线网卡驱动 for 32位64位
评论
共有 条评论