Commit 4249291d authored by son nguyen's avatar son nguyen

unlock by device out with pulse

parent a94db97c

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPCommSharpClient", "WPCommSharpClient\WPCommSharpClient.csproj", "{BAE221A6-0675-4198-B743-1BC6B1AECDA1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BAE221A6-0675-4198-B743-1BC6B1AECDA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAE221A6-0675-4198-B743-1BC6B1AECDA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAE221A6-0675-4198-B743-1BC6B1AECDA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAE221A6-0675-4198-B743-1BC6B1AECDA1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>

using Accw;
using Microsoft.Extensions.Configuration;
using Serilog;
using System;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Http;
using WPCommSharpClient.FormRequests;
namespace WPCommSharpClient
{
public class ApiController : System.Web.Http.ApiController
{
private readonly MTSCBServerClass _server;
private readonly WPCallbackClient _client;
public ApiController(MTSCBServerClass server)
{
_server = server ?? throw new ArgumentNullException(nameof(server));
_client = new WPCallbackClient();
}
[HttpPost]
[Route("api/login")]
public async Task<IHttpActionResult> Login([FromBody] FormLoginRequest loginRequest)
{
Log.Debug("Calling login....");
if (loginRequest == null)
{
return Json(ResponseResult<object>.ErrorResult("Invalid login request."));
}
try
{
bool isConnected = string.IsNullOrWhiteSpace(loginRequest.Domain)
? _server.InitServer(_client, 3, loginRequest.UserName, loginRequest.Password, 1)
: _server.InitServer2(_client, 3, loginRequest.UserName, loginRequest.Password, loginRequest.Domain, 1);
Log.Information("Login {Status}", isConnected ? "successful" : "failed");
//var listDevice = _server.ListConnectedDevices();
//Log.Debug(listDevice.ToString());
if (isConnected)
{
return Json(ResponseResult<object>.SuccessResult(null, "Login successful."));
}
else
{
return Json(ResponseResult<object>.ErrorResult("Login failed."));
}
}
catch (Exception ex)
{
Log.Error(ex, "Login failed.");
return Json(ResponseResult<object>.ErrorResult("An error occurred during login."));
}
}
[HttpGet]
[Route("api/logout")]
public async Task<IHttpActionResult> logout()
{
Log.Debug("Calling logout....");
int isConnected = 0;
_server.IsConnected(out isConnected);
if(isConnected > 0)
{
bool isLogout = _server.DoneServer(_client);
if( isLogout)
{
Log.Debug("Logout successfully.");
return Json(ResponseResult<object>.SuccessResult(null, "Logout successfully"));
}
else
{
return Json(ResponseResult<object>.ErrorResult("Logout fail"));
}
}
return Json(ResponseResult<object>.ErrorResult("Server not login!!!"));
}
[HttpPost]
[Route("api/unLock")]
public async Task<IHttpActionResult> EntryUnLockById([FromBody] FormLockRequest formLockRequest)
{
DateTime startCallAPI = DateTime.Now;
Log.Debug("Calling unlock ....");
// Đọc cấu hình từ appsettings.json // 1 thu vien doc file json
IConfiguration configuration = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build();
var login = configuration.GetSection("login");
string username = login["username"];
string password = login["password"];
Log.Debug("Username: " + username);
Log.Debug("Password: " + password);
if(string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
{
Log.Error("Not found username or password!");
return Json(ResponseResult<Object>.ErrorResult("Not found username or password!"));
}
// goị tới login của server
// _client: mặc định với _client là đối tượng có sẵn
// 3 : tức nhận cả Alarm và Event( 1: Alarm, 2: Event )
// username
// password
// 1: id của user đăng nhâp(ở đây đăng nhập với user mặc định ban đầu của winPak là 1)
bool isConnected = _server.InitServer(_client, 3, username, password, 1);
if(isConnected)
{
if (formLockRequest?.HID == null)
{
Log.Error("Not found HID!!!");
return Json(ResponseResult<String>.ErrorResult("HID is required."));
}
try
{
int hID = (int) formLockRequest.HID.Value;
// Hàm nhận vào 1 giá trị là Hardware ID cua output
Log.Debug("Call Pulse.....");
_server.PulseByHID(hID);
TimeSpan totalTime = (DateTime.Now - startCallAPI);
Log.Debug($"Total time: {totalTime.TotalMilliseconds} ms");
return Json(ResponseResult<String>.SuccessResult(null, "UnLock successful."));
}
catch (Exception ex)
{
Log.Error(ex, "Failed to unlock entry.");
return Json(ResponseResult<String>.ErrorResult("An error occurred during unlocking."));
}
}else
{
Log.Error("Error Login with initServer");
return Json(ResponseResult<object>.ErrorResult("An error occurred during login."));
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WPCommSharpClient.FormRequests
{
public class FormLockRequest
{
public int? HID { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WPCommSharpClient.FormRequests
{
public class FormLoginRequest
{
public string UserName { get; set; }
public string Password { get; set; }
public string Domain { get; set; }
}
}
using Serilog;
using Microsoft.Extensions.Configuration;
using System;
namespace WPCommSharpClient
{
public static class LoggingConfig
{
public static void ConfigureLogger(IConfiguration configuration)
{
var loggingConfig = configuration.GetSection("Logging");
string logFilePath = loggingConfig["LogFilePath"] ?? "Logs/log-.txt";
string rollingInterval = loggingConfig["RollingInterval"] ?? "Day";
int retainedFileCountLimit = int.TryParse(loggingConfig["RetainedFileCountLimit"], out var limit) ? limit : 7;
// Cấu hình Serilog để lưu tất cả log
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose() // Ghi mọi log từ Verbose trở lên
.WriteTo.Console() // Ghi log ra console
.WriteTo.File(
path: logFilePath,
rollingInterval: Enum.TryParse<RollingInterval>(rollingInterval, true, out var interval) ? interval : RollingInterval.Day,
retainedFileCountLimit: retainedFileCountLimit,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"
) // Ghi log vào file
.CreateLogger();
}
}
}
namespace WPCommSharpClient
{
public class ResponseResult<T>
{
public bool Success { get; set; } // Trạng thái thành công hoặc thất bại
public string Message { get; set; } // Thông điệp kèm theo
public T Data { get; set; } // Dữ liệu trả về (nếu có)
public ResponseResult() { }
public ResponseResult(bool success, string message, T data)
{
Success = success;
Message = message;
Data = data;
}
public static ResponseResult<T> SuccessResult(T data, string message = "Success")
{
return new ResponseResult<T>(true, message, data);
}
public static ResponseResult<T> ErrorResult(string message, T data = default)
{
return new ResponseResult<T>(false, message, data);
}
}
}
namespace WPCommSharpClient
{
partial class MainView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainView));
this.label1 = new System.Windows.Forms.Label();
this.txtUserName = new System.Windows.Forms.TextBox();
this.txtPassword = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.btnLogin = new System.Windows.Forms.Button();
this.listMessages = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.logoutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.txtDomain = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// txtUserName
//
resources.ApplyResources(this.txtUserName, "txtUserName");
this.txtUserName.Name = "txtUserName";
//
// txtPassword
//
resources.ApplyResources(this.txtPassword, "txtPassword");
this.txtPassword.Name = "txtPassword";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// btnLogin
//
resources.ApplyResources(this.btnLogin, "btnLogin");
this.btnLogin.Name = "btnLogin";
this.btnLogin.UseVisualStyleBackColor = true;
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
//
// listMessages
//
this.listMessages.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1});
resources.ApplyResources(this.listMessages, "listMessages");
this.listMessages.FullRowSelect = true;
this.listMessages.GridLines = true;
this.listMessages.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listMessages.HideSelection = false;
this.listMessages.Name = "listMessages";
this.listMessages.UseCompatibleStateImageBehavior = false;
this.listMessages.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
resources.ApplyResources(this.columnHeader1, "columnHeader1");
//
// menuStrip1
//
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem});
resources.ApplyResources(this.menuStrip1, "menuStrip1");
this.menuStrip1.Name = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.logoutToolStripMenuItem,
this.toolStripSeparator1,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem");
//
// logoutToolStripMenuItem
//
this.logoutToolStripMenuItem.Name = "logoutToolStripMenuItem";
resources.ApplyResources(this.logoutToolStripMenuItem, "logoutToolStripMenuItem");
this.logoutToolStripMenuItem.Click += new System.EventHandler(this.logoutToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
resources.ApplyResources(this.exitToolStripMenuItem, "exitToolStripMenuItem");
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// txtDomain
//
resources.ApplyResources(this.txtDomain, "txtDomain");
this.txtDomain.Name = "txtDomain";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.Name = "label3";
//
// MainView
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.txtDomain);
this.Controls.Add(this.label3);
this.Controls.Add(this.listMessages);
this.Controls.Add(this.btnLogin);
this.Controls.Add(this.txtPassword);
this.Controls.Add(this.label2);
this.Controls.Add(this.txtUserName);
this.Controls.Add(this.label1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "MainView";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtUserName;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btnLogin;
private System.Windows.Forms.ListView listMessages;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem logoutToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.TextBox txtDomain;
private System.Windows.Forms.Label label3;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Accw;
namespace WPCommSharpClient
{
public partial class MainView : Form
{
private WPCallbackClient client;
private MTSCBServerClass server;
// This delegate enables asynchronous calls for setting
// the text property on a TextBox control.
private delegate void InsertMessageCallback(string text);
private Thread messageProcessor;
public MainView()
{
InitializeComponent();
try
{
client = new WPCallbackClient();
server = new MTSCBServerClass();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error on creating MTSCBServer instance");
throw;
}
}
private void btnLogin_Click(object sender, EventArgs e)
{
int iUserID = 1;
bool bConnected = false;
try
{
if (string.IsNullOrWhiteSpace(txtDomain.Text.Trim()))
bConnected = server.InitServer(client, 3, txtUserName.Text, txtPassword.Text, iUserID);
else
bConnected = server.InitServer2(client, 3, txtUserName.Text, txtPassword.Text, txtDomain.Text, iUserID);
}
catch (Exception ex)
{
throw;
}
if(bConnected)
{
MessageBox.Show("Login success");
messageProcessor = new Thread(ProcessMessages);
messageProcessor.IsBackground = true;
messageProcessor.Start();
}
}
private void ProcessMessages()
{
while(true)
{
lock (client.messageQueue)
{
if (client.messageQueue.Count > 0)
{
string sMessage = client.messageQueue.Dequeue();
InsertMessage(sMessage);
}
}
}
}
private void InsertMessage(string message)
{
if (this.InvokeRequired)
{
this.Invoke(new InsertMessageCallback(InsertMessage), new object[] { message });
return;
}
listMessages.Items.Add(message);
}
private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
{
int iConnected = 0;
server.IsConnected(out iConnected);
if(iConnected > 0)
server.DoneServer(client);
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
int iConnected = 0;
server.IsConnected(out iConnected);
if (iConnected > 0)
server.DoneServer(client);
this.Close();
}
}
}
using System;
using System.Windows.Forms;
using Microsoft.Extensions.Configuration;
using Microsoft.Owin.Hosting;
using Serilog;
namespace WPCommSharpClient
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// Đọc cấu hình từ appsettings.json // 1 thu vien doc file json
IConfiguration configuration = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build();
// Cấu hình Serilog
LoggingConfig.ConfigureLogger(configuration);
string baseAddress = configuration["BaseAddress"];
if (string.IsNullOrEmpty(baseAddress))
{
Log.Debug("baseAddress not found in appsettings.json");
return;
}
WebApp.Start<Startup>(url: baseAddress);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainView());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WPCommSharpClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Honeywell")]
[assembly: AssemblyProduct("WPCommSharpClient")]
[assembly: AssemblyCopyright("Copyright © Honeywell 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("00fe4ca4-52fb-4976-83a2-a6aa67f27223")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WPCommSharpClient.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WPCommSharpClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WPCommSharpClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")]
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 {
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
\ No newline at end of file
using System.Web.Http;
using Accw;
using Owin;
using SimpleInjector;
using SimpleInjector.Integration.WebApi;
using SimpleInjector.Lifestyles;
namespace WPCommSharpClient
{
public class Startup
{
public void Configuration(IAppBuilder appBuilder)
{
var container = ConfigureDependencyInjection();
HttpConfiguration config = ConfigureWebApi(container);
appBuilder.UseWebApi(config);
}
private Container ConfigureDependencyInjection()
{
var container = new Container();
container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
// Suwr dungj singleton xuyen suot vong doi ung dung
container.Register<MTSCBServerClass>(Lifestyle.Singleton);
container.Register<ApiController>(Lifestyle.Scoped);
container.Verify();
return container;
}
private HttpConfiguration ConfigureWebApi(Container container)
{
var config = new HttpConfiguration
{
DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container)
};
// Thiết lập DependencyResolver để sử dụng Simple Injector
config.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container);
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
// config.Filters.Add(new AuthorizeAttribute()); // Thêm kiểm tra xác thực
return config;
}
}
}
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Accw;
namespace WPCommSharpClient
{
[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ComVisibleAttribute(true)]
public sealed class WPCallbackClient : Attribute, IWPAVCallBack, IDisposable
{
#region Member variables
public Queue<string> messageQueue;
public Queue<string> errorQueue;
#endregion
#region Constructor
/// <summary>
/// Ctor
/// </summary>
public WPCallbackClient()
{
messageQueue = new Queue<string>();
errorQueue = new Queue<string>();
}
#endregion
#region IDisposable Member
public void Dispose()
{
}
#endregion
public override object TypeId
{
get
{
return base.TypeId;
}
}
#region IWPAVCallBack Member
void IWPAVCallBack.GotMessage(string bstrTranInfo)
{
if (String.IsNullOrEmpty(bstrTranInfo))
return;
lock (messageQueue)
{
messageQueue.Enqueue(bstrTranInfo);
}
}
void IWPAVCallBack.ServerError(string bstrErrorInfo)
{
if (String.IsNullOrEmpty(bstrErrorInfo))
return;
lock (errorQueue)
{
errorQueue.Enqueue(bstrErrorInfo);
}
}
#endregion
}
}

using Accw;
using Serilog;
using System;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Http;
namespace WPCommSharpClient
{
public class WinPakController : ApiController
{
private readonly MTSCBServerClass _server;
private readonly WPCallbackClient _client;
public WinPakController(MTSCBServerClass server)
{
_server = server ?? throw new ArgumentNullException(nameof(server));
_client = new WPCallbackClient();
}
[HttpPost]
[Route("api/login")]
public async Task<IHttpActionResult> Login([FromBody] LoginRequest loginRequest)
{
//this._server = new MTSCBServerClass();
Log.Debug("Calling login....");
if (loginRequest == null)
{
return Json(ResponseResult<object>.ErrorResult("Invalid login request."));
}
try
{
bool isConnected = string.IsNullOrWhiteSpace(loginRequest.Domain)
? _server.InitServer(_client, 3, loginRequest.UserName, loginRequest.Password, 1)
: _server.InitServer2(_client, 3, loginRequest.UserName, loginRequest.Password, loginRequest.Domain, 1);
Log.Information("Login {Status}", isConnected ? "successful" : "failed");
//var listDevice = _server.ListConnectedDevices();
//Log.Debug(listDevice.ToString());
if (isConnected)
{
return Json(ResponseResult<object>.SuccessResult(null, "Login successful."));
}
else
{
return Json(ResponseResult<object>.ErrorResult("Login failed."));
}
}
catch (Exception ex)
{
Log.Error(ex, "Login failed.");
return Json(ResponseResult<object>.ErrorResult("An error occurred during login."));
}
}
//public async Task<IHttpActionResult> LoginAuto()
//{
// //this._server = new MTSCBServerClass();
// try
// {
// bool isConnected = string.IsNullOrWhiteSpace(loginRequest.Domain)
// ? _server.InitServer(_client, 3, loginRequest.UserName, loginRequest.Password, 1)
// : _server.InitServer2(_client, 3, loginRequest.UserName, loginRequest.Password, loginRequest.Domain, 1);
// Log.Information("Login {Status}", isConnected ? "successful" : "failed");
// //var listDevice = _server.ListConnectedDevices();
// //Log.Debug(listDevice.ToString());
// if (isConnected)
// {
// return Json(ResponseResult<object>.SuccessResult(null, "Login successful."));
// }
// else
// {
// return Json(ResponseResult<object>.ErrorResult("Login failed."));
// }
// }
// catch (Exception ex)
// {
// Log.Error(ex, "Login failed.");
// return Json(ResponseResult<object>.ErrorResult("An error occurred during login."));
// }
//}
[HttpGet]
[Route("api/logout")]
public async Task<IHttpActionResult> logout()
{
Log.Debug("Calling logout....");
int isConnected = 0;
_server.IsConnected(out isConnected);
if(isConnected > 0)
{
bool isLogout = _server.DoneServer(_client);
if( isLogout)
{
Log.Debug("Logout successfully.");
return Json(ResponseResult<object>.SuccessResult(null, "Logout successfully"));
}
else
{
return Json(ResponseResult<object>.ErrorResult("Logout fail"));
}
}
return Json(ResponseResult<object>.ErrorResult("Server not login!!!"));
}
[HttpPost]
[Route("api/lock")]
public async Task<IHttpActionResult> EntryLockById([FromBody] FormLockRequest formLockRequest)
{
if (formLockRequest?.HID == null)
{
return Json(ResponseResult<object>.ErrorResult("HID is required."));
}
try
{
if (formLockRequest.Point != 0)
{
_server.EntryPointLock(formLockRequest.HID.Value, formLockRequest.Point.Value);
}
else
{
_server.EntryPointLockByHID(formLockRequest.HID.Value);
}
Log.Debug("Lock successful for HID={HID}", formLockRequest.HID);
return Json(ResponseResult<object>.SuccessResult(null, "Lock successful."));
}
catch (Exception ex)
{
Log.Error(ex, "Failed to lock entry.");
return Json(ResponseResult<object>.ErrorResult("An error occurred during locking."));
}
}
[HttpPost]
[Route("api/unLock")]
public async Task<IHttpActionResult> EntryUnLockById([FromBody] FormLockRequest formLockRequest)
{
if (formLockRequest?.HID == null)
{
return Json(ResponseResult<String>.ErrorResult("HID is required."));
}
try
{
if (formLockRequest.Point != 0)
{
_server.EntryPointUnLock(formLockRequest.HID.Value, formLockRequest.Point.Value);
}
else
{
_server.EntryPointUnLockByHID(formLockRequest.HID.Value);
}
Log.Debug("Lock successful for HID={HID}", formLockRequest.HID);
return Json(ResponseResult<String>.SuccessResult(null, "Lock successful."));
}
catch (Exception ex)
{
Log.Error(ex, "Failed to lock entry.");
return Json(ResponseResult<String>.ErrorResult("An error occurred during locking."));
}
}
[HttpGet]
[Route("api/getStatus")]
public async Task<IHttpActionResult> GetConnectToServer()
{
if (_server == null)
{
Log.Error("Server instance is null");
return Json(ResponseResult<object>.ErrorResult("Server instance is null."));
}
try
{
_server.IsConnected(out int isConnected);
Log.Information("Connection status: {Status}", isConnected == 1 ? "Connected" : "Disconnected");
return isConnected == 1
? Json(ResponseResult<object>.SuccessResult(null, "Server is connected."))
: Json(ResponseResult<object>.ErrorResult("Server is not connected."));
}
catch (Exception ex)
{
Log.Error(ex, "Failed to check connection status.");
return Json(ResponseResult<object>.ErrorResult("An error occurred while checking the server status."));
}
}
[HttpGet]
[Route("api/getListDevice")]
public async Task<IHttpActionResult> getListDevice()
{
try
{
Log.Debug("Getting list device.....");
_server.IsConnected(out int isConnected);
if (isConnected == 0)
{
Log.Error("Server is not connected.");
return Json(ResponseResult<object>.ErrorResult("Server is not connected."));
}
Log.Debug("Get list Device.");
object myObject = _server.ListConnectedDevices(); // Đối tượng của bạn
Log.Debug("Get list device success");
Type type = myObject.GetType();
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo property in properties)
{
Console.WriteLine($"{property.Name}: {property.GetValue(myObject)}");
}
return Json(ResponseResult<object>.SuccessResult("Get list device successfull"));
}
catch(Exception ex)
{
return Json(ResponseResult<object>.ErrorResult("Error get list device!!!"));
}
}
}
public class InfoDeviceView
{
}
public class LoginRequest
{
public string UserName { get; set; }
public string Password { get; set; }
public string Domain { get; set; }
}
public class FormLockRequest
{
public int? HID { get; set; }
public int? Point { get; set; }
}
}
{
"BaseAddress": "http://192.168.1.21:4000/",
"Logging": {
"LogFilePath": "Logs/log-.txt",
"RollingInterval": "Day",
"RetainedFileCountLimit": 7
},
"login": {
"username": "admin",
"password": "Vht\"20252026"
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net48" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.3.0" targetFramework="net48" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.3.0" targetFramework="net48" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.3.0" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Binder" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.FileExtensions" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Json" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.FileProviders.Physical" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Primitives" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Owin" version="4.2.2" targetFramework="net48" />
<package id="Microsoft.Owin.Host.HttpListener" version="4.2.2" targetFramework="net48" />
<package id="Microsoft.Owin.Hosting" version="4.2.2" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net48" />
<package id="Owin" version="1.0" targetFramework="net48" />
<package id="Serilog" version="4.2.0" targetFramework="net48" />
<package id="Serilog.Sinks.Console" version="6.0.0" targetFramework="net48" />
<package id="Serilog.Sinks.File" version="6.0.0" targetFramework="net48" />
<package id="SimpleInjector" version="5.5.0" targetFramework="net48" />
<package id="SimpleInjector.Integration.WebApi" version="5.5.0" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Diagnostics.DiagnosticSource" version="8.0.1" targetFramework="net48" />
<package id="System.IO.Pipelines" version="9.0.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="9.0.0" targetFramework="net48" />
<package id="System.Text.Json" version="9.0.0" targetFramework="net48" />
<package id="System.Threading.Channels" version="8.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
</packages>
\ No newline at end of file
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one
of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft
services or updates for the software, except to the extent those have different terms.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
You may install and use any number of copies of the software to design, develop and test you’re
applications. You may modify, copy, distribute or deploy any .js files contained in the software as
part of your applications.
2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal
notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s)
accompanying the software.
3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised
of Distributable Code. “Distributable Code” is code that you are permitted to distribute in
programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
• You may copy and distribute the object code form of the software.
• Third Party Distribution. You may permit distributors of your programs to copy and
distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
• use the Distributable Code in your programs and not as a standalone distribution;
• require distributors and external end users to agree to terms that protect it at least as
much as this agreement;
• display your valid copyright notice on your programs; and
• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’
fees, related to the distribution or use of your applications, except to the extent that any
claim is based solely on the Distributable Code.
iii. Distribution Restrictions. You may not
• alter any copyright, trademark or patent notice in the Distributable Code;
• use Microsoft’s trademarks in your programs’ names or in a way that suggests your
programs come from or are endorsed by Microsoft;
• include Distributable Code in malicious, deceptive or unlawful programs; or
• modify or distribute the source code of any Distributable Code so that any part of it
becomes subject to an Excluded License. An Excluded License is one that requires, as a
condition of use, modification or distribution, that
• the code be disclosed or distributed in source code form; or
• others have the right to modify it.
4. DATA.
a. Data Collection. The software may collect information about you and your use of the software,
and send that to Microsoft. Microsoft may use this information to provide services and improve
our products and services. You may opt-out of many of these scenarios, but not all, as described
in the product documentation. There are also some features in the software that may enable
you and Microsoft to collect data from users of your applications. If you use these features, you
must comply with applicable law, including providing appropriate notices to users of your
applications together with a copy of Microsoft’s privacy statement. Our privacy statement is
located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data
collection and use in the help documentation and our privacy statement. Your use of the software
operates as your consent to these practices.
b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of
personal data in connection with the software, Microsoft makes the commitments in the
European Union General Data Protection Regulation Terms of the Online Services Terms to all
customers effective May 25, 2018, at https://aka.ms/aspnet/gdpr.
5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights
to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights
despite this limitation, you may use the software only as expressly permitted in this agreement. In
doing so, you must comply with any technical limitations in the software that only allow you to use it
in certain ways. You may not
• work around any technical limitations in the software;
• reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the
source code for the software, except and to the extent required by third party licensing terms
governing use of certain open source components that may be included in the software;
• remove, minimize, block or modify any notices of Microsoft or its suppliers in the software;
• use the software in any way that is against the law; or
• share, publish, rent or lease the software, provide the software as a stand-alone offering for
others to use, or transfer the software or this agreement to any third party.
6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall
the software.
7. DOCUMENTATION. Any person that has valid access to your computer or internal network may
copy and use the documentation for your internal, reference purposes.
8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and
regulations that apply to the software, which include restrictions on destinations, end users, and end
use. For further information on export restrictions, visit www.microsoft.com/exporting.
9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based
services and support services that you use, are the entire agreement for the software and support
services.
11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to
interpretation of and claims for breach of this agreement, and the laws of the state where you live
apply to all other claims. If you acquired the software in any other country, its laws apply.
12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights.
You may have other rights, including consumer rights, under the laws of your state or country.
Separate and apart from your relationship with Microsoft, you may also have rights with respect to
the party from which you acquired the software. This agreement does not change those other rights
if the laws of your state or country do not permit it to do so. For example, if you acquired the
software in one of the below regions, or mandatory country law applies, then the following provisions
apply to you:
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in
this agreement is intended to affect those rights.
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off
the automatic update feature, disconnecting your device from the Internet (if and when you re-
connect to the Internet, however, the software will resume checking for and installing updates),
or uninstalling the software. The product documentation, if any, may also specify how to turn off
updates for your specific device or software.
c) Germany and Austria.
(i) Warranty. The software will perform substantially as described in any Microsoft
materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the
software.
(ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based
on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is
liable according to the statutory law.
Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in
breach of such material contractual obligations, the fulfillment of which facilitate the due
performance of this agreement, the breach of which would endanger the purpose of this agreement
and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In
other cases of slight negligence, Microsoft will not be liable for slight negligence
13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK
OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT
EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER
FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS,
SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to (a) anything related to the software, services, content (including code) on
third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of
warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by
applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages.
The above limitation or exclusion may not apply to you because your state or country may not allow
the exclusion or limitation of incidental, consequential or other damages.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</configuration>
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one
of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft
services or updates for the software, except to the extent those have different terms.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
You may install and use any number of copies of the software to design, develop and test you’re
applications. You may modify, copy, distribute or deploy any .js files contained in the software as
part of your applications.
2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal
notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s)
accompanying the software.
3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised
of Distributable Code. “Distributable Code” is code that you are permitted to distribute in
programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
• You may copy and distribute the object code form of the software.
• Third Party Distribution. You may permit distributors of your programs to copy and
distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
• use the Distributable Code in your programs and not as a standalone distribution;
• require distributors and external end users to agree to terms that protect it at least as
much as this agreement;
• display your valid copyright notice on your programs; and
• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’
fees, related to the distribution or use of your applications, except to the extent that any
claim is based solely on the Distributable Code.
iii. Distribution Restrictions. You may not
• alter any copyright, trademark or patent notice in the Distributable Code;
• use Microsoft’s trademarks in your programs’ names or in a way that suggests your
programs come from or are endorsed by Microsoft;
• include Distributable Code in malicious, deceptive or unlawful programs; or
• modify or distribute the source code of any Distributable Code so that any part of it
becomes subject to an Excluded License. An Excluded License is one that requires, as a
condition of use, modification or distribution, that
• the code be disclosed or distributed in source code form; or
• others have the right to modify it.
4. DATA.
a. Data Collection. The software may collect information about you and your use of the software,
and send that to Microsoft. Microsoft may use this information to provide services and improve
our products and services. You may opt-out of many of these scenarios, but not all, as described
in the product documentation. There are also some features in the software that may enable
you and Microsoft to collect data from users of your applications. If you use these features, you
must comply with applicable law, including providing appropriate notices to users of your
applications together with a copy of Microsoft’s privacy statement. Our privacy statement is
located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data
collection and use in the help documentation and our privacy statement. Your use of the software
operates as your consent to these practices.
b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of
personal data in connection with the software, Microsoft makes the commitments in the
European Union General Data Protection Regulation Terms of the Online Services Terms to all
customers effective May 25, 2018, at https://aka.ms/aspnet/gdpr.
5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights
to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights
despite this limitation, you may use the software only as expressly permitted in this agreement. In
doing so, you must comply with any technical limitations in the software that only allow you to use it
in certain ways. You may not
• work around any technical limitations in the software;
• reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the
source code for the software, except and to the extent required by third party licensing terms
governing use of certain open source components that may be included in the software;
• remove, minimize, block or modify any notices of Microsoft or its suppliers in the software;
• use the software in any way that is against the law; or
• share, publish, rent or lease the software, provide the software as a stand-alone offering for
others to use, or transfer the software or this agreement to any third party.
6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall
the software.
7. DOCUMENTATION. Any person that has valid access to your computer or internal network may
copy and use the documentation for your internal, reference purposes.
8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and
regulations that apply to the software, which include restrictions on destinations, end users, and end
use. For further information on export restrictions, visit www.microsoft.com/exporting.
9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based
services and support services that you use, are the entire agreement for the software and support
services.
11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to
interpretation of and claims for breach of this agreement, and the laws of the state where you live
apply to all other claims. If you acquired the software in any other country, its laws apply.
12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights.
You may have other rights, including consumer rights, under the laws of your state or country.
Separate and apart from your relationship with Microsoft, you may also have rights with respect to
the party from which you acquired the software. This agreement does not change those other rights
if the laws of your state or country do not permit it to do so. For example, if you acquired the
software in one of the below regions, or mandatory country law applies, then the following provisions
apply to you:
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in
this agreement is intended to affect those rights.
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off
the automatic update feature, disconnecting your device from the Internet (if and when you re-
connect to the Internet, however, the software will resume checking for and installing updates),
or uninstalling the software. The product documentation, if any, may also specify how to turn off
updates for your specific device or software.
c) Germany and Austria.
(i) Warranty. The software will perform substantially as described in any Microsoft
materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the
software.
(ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based
on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is
liable according to the statutory law.
Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in
breach of such material contractual obligations, the fulfillment of which facilitate the due
performance of this agreement, the breach of which would endanger the purpose of this agreement
and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In
other cases of slight negligence, Microsoft will not be liable for slight negligence
13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK
OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT
EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER
FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS,
SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to (a) anything related to the software, services, content (including code) on
third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of
warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by
applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages.
The above limitation or exclusion may not apply to you because your state or country may not allow
the exclusion or limitation of incidental, consequential or other damages.
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one
of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft
services or updates for the software, except to the extent those have different terms.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
You may install and use any number of copies of the software to design, develop and test you’re
applications. You may modify, copy, distribute or deploy any .js files contained in the software as
part of your applications.
2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal
notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s)
accompanying the software.
3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised
of Distributable Code. “Distributable Code” is code that you are permitted to distribute in
programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
• You may copy and distribute the object code form of the software.
• Third Party Distribution. You may permit distributors of your programs to copy and
distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
• use the Distributable Code in your programs and not as a standalone distribution;
• require distributors and external end users to agree to terms that protect it at least as
much as this agreement;
• display your valid copyright notice on your programs; and
• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’
fees, related to the distribution or use of your applications, except to the extent that any
claim is based solely on the Distributable Code.
iii. Distribution Restrictions. You may not
• alter any copyright, trademark or patent notice in the Distributable Code;
• use Microsoft’s trademarks in your programs’ names or in a way that suggests your
programs come from or are endorsed by Microsoft;
• include Distributable Code in malicious, deceptive or unlawful programs; or
• modify or distribute the source code of any Distributable Code so that any part of it
becomes subject to an Excluded License. An Excluded License is one that requires, as a
condition of use, modification or distribution, that
• the code be disclosed or distributed in source code form; or
• others have the right to modify it.
4. DATA.
a. Data Collection. The software may collect information about you and your use of the software,
and send that to Microsoft. Microsoft may use this information to provide services and improve
our products and services. You may opt-out of many of these scenarios, but not all, as described
in the product documentation. There are also some features in the software that may enable
you and Microsoft to collect data from users of your applications. If you use these features, you
must comply with applicable law, including providing appropriate notices to users of your
applications together with a copy of Microsoft’s privacy statement. Our privacy statement is
located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data
collection and use in the help documentation and our privacy statement. Your use of the software
operates as your consent to these practices.
b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of
personal data in connection with the software, Microsoft makes the commitments in the
European Union General Data Protection Regulation Terms of the Online Services Terms to all
customers effective May 25, 2018, at https://aka.ms/aspnet/gdpr.
5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights
to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights
despite this limitation, you may use the software only as expressly permitted in this agreement. In
doing so, you must comply with any technical limitations in the software that only allow you to use it
in certain ways. You may not
• work around any technical limitations in the software;
• reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the
source code for the software, except and to the extent required by third party licensing terms
governing use of certain open source components that may be included in the software;
• remove, minimize, block or modify any notices of Microsoft or its suppliers in the software;
• use the software in any way that is against the law; or
• share, publish, rent or lease the software, provide the software as a stand-alone offering for
others to use, or transfer the software or this agreement to any third party.
6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall
the software.
7. DOCUMENTATION. Any person that has valid access to your computer or internal network may
copy and use the documentation for your internal, reference purposes.
8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and
regulations that apply to the software, which include restrictions on destinations, end users, and end
use. For further information on export restrictions, visit www.microsoft.com/exporting.
9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based
services and support services that you use, are the entire agreement for the software and support
services.
11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to
interpretation of and claims for breach of this agreement, and the laws of the state where you live
apply to all other claims. If you acquired the software in any other country, its laws apply.
12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights.
You may have other rights, including consumer rights, under the laws of your state or country.
Separate and apart from your relationship with Microsoft, you may also have rights with respect to
the party from which you acquired the software. This agreement does not change those other rights
if the laws of your state or country do not permit it to do so. For example, if you acquired the
software in one of the below regions, or mandatory country law applies, then the following provisions
apply to you:
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in
this agreement is intended to affect those rights.
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off
the automatic update feature, disconnecting your device from the Internet (if and when you re-
connect to the Internet, however, the software will resume checking for and installing updates),
or uninstalling the software. The product documentation, if any, may also specify how to turn off
updates for your specific device or software.
c) Germany and Austria.
(i) Warranty. The software will perform substantially as described in any Microsoft
materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the
software.
(ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based
on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is
liable according to the statutory law.
Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in
breach of such material contractual obligations, the fulfillment of which facilitate the due
performance of this agreement, the breach of which would endanger the purpose of this agreement
and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In
other cases of slight negligence, Microsoft will not be liable for slight negligence
13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK
OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT
EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER
FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS,
SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to (a) anything related to the software, services, content (including code) on
third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of
warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by
applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages.
The above limitation or exclusion may not apply to you because your state or country may not allow
the exclusion or limitation of incidental, consequential or other damages.
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one
of its affiliates) and you. They apply to the software named above. The terms also apply to any Microsoft
services or updates for the software, except to the extent those have different terms.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
You may install and use any number of copies of the software to design, develop and test you’re
applications. You may modify, copy, distribute or deploy any .js files contained in the software as
part of your applications.
2. THIRD PARTY COMPONENTS. The software may include third party components with separate legal
notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s)
accompanying the software.
3. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. In addition to the .js files described above, the software is comprised
of Distributable Code. “Distributable Code” is code that you are permitted to distribute in
programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
• You may copy and distribute the object code form of the software.
• Third Party Distribution. You may permit distributors of your programs to copy and
distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
• use the Distributable Code in your programs and not as a standalone distribution;
• require distributors and external end users to agree to terms that protect it at least as
much as this agreement;
• display your valid copyright notice on your programs; and
• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’
fees, related to the distribution or use of your applications, except to the extent that any
claim is based solely on the Distributable Code.
iii. Distribution Restrictions. You may not
• alter any copyright, trademark or patent notice in the Distributable Code;
• use Microsoft’s trademarks in your programs’ names or in a way that suggests your
programs come from or are endorsed by Microsoft;
• include Distributable Code in malicious, deceptive or unlawful programs; or
• modify or distribute the source code of any Distributable Code so that any part of it
becomes subject to an Excluded License. An Excluded License is one that requires, as a
condition of use, modification or distribution, that
• the code be disclosed or distributed in source code form; or
• others have the right to modify it.
4. DATA.
a. Data Collection. The software may collect information about you and your use of the software,
and send that to Microsoft. Microsoft may use this information to provide services and improve
our products and services. You may opt-out of many of these scenarios, but not all, as described
in the product documentation. There are also some features in the software that may enable
you and Microsoft to collect data from users of your applications. If you use these features, you
must comply with applicable law, including providing appropriate notices to users of your
applications together with a copy of Microsoft’s privacy statement. Our privacy statement is
located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data
collection and use in the help documentation and our privacy statement. Your use of the software
operates as your consent to these practices.
b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of
personal data in connection with the software, Microsoft makes the commitments in the
European Union General Data Protection Regulation Terms of the Online Services Terms to all
customers effective May 25, 2018, at https://aka.ms/aspnet/gdpr.
5. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights
to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights
despite this limitation, you may use the software only as expressly permitted in this agreement. In
doing so, you must comply with any technical limitations in the software that only allow you to use it
in certain ways. You may not
• work around any technical limitations in the software;
• reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the
source code for the software, except and to the extent required by third party licensing terms
governing use of certain open source components that may be included in the software;
• remove, minimize, block or modify any notices of Microsoft or its suppliers in the software;
• use the software in any way that is against the law; or
• share, publish, rent or lease the software, provide the software as a stand-alone offering for
others to use, or transfer the software or this agreement to any third party.
6. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall
the software.
7. DOCUMENTATION. Any person that has valid access to your computer or internal network may
copy and use the documentation for your internal, reference purposes.
8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and
regulations that apply to the software, which include restrictions on destinations, end users, and end
use. For further information on export restrictions, visit www.microsoft.com/exporting.
9. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
10. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based
services and support services that you use, are the entire agreement for the software and support
services.
11. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to
interpretation of and claims for breach of this agreement, and the laws of the state where you live
apply to all other claims. If you acquired the software in any other country, its laws apply.
12. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights.
You may have other rights, including consumer rights, under the laws of your state or country.
Separate and apart from your relationship with Microsoft, you may also have rights with respect to
the party from which you acquired the software. This agreement does not change those other rights
if the laws of your state or country do not permit it to do so. For example, if you acquired the
software in one of the below regions, or mandatory country law applies, then the following provisions
apply to you:
a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in
this agreement is intended to affect those rights.
b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off
the automatic update feature, disconnecting your device from the Internet (if and when you re-
connect to the Internet, however, the software will resume checking for and installing updates),
or uninstalling the software. The product documentation, if any, may also specify how to turn off
updates for your specific device or software.
c) Germany and Austria.
(i) Warranty. The software will perform substantially as described in any Microsoft
materials that accompany it. However, Microsoft gives no contractual guarantee in relation to the
software.
(ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based
on the Product Liability Act, as well as in case of death or personal or physical injury, Microsoft is
liable according to the statutory law.
Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in
breach of such material contractual obligations, the fulfillment of which facilitate the due
performance of this agreement, the breach of which would endanger the purpose of this agreement
and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In
other cases of slight negligence, Microsoft will not be liable for slight negligence
13. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK
OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR
CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT
EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER
FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU
CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS,
SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to (a) anything related to the software, services, content (including code) on
third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of
warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by
applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages.
The above limitation or exclusion may not apply to you because your state or country may not allow
the exclusion or limitation of incidental, consequential or other damages.
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## About
As of C# 8, the C# language has support for producing and consuming asynchronous iterators. The library types in support of those features are available in .NET Core 3.0 and newer as well as in .NET Standard 2.1. This library provides the necessary definitions of those types to support these language features on .NET Framework and on .NET Standard 2.0. This library is not necessary nor recommended when targeting versions of .NET that include the relevant support.
## Key Features
<!-- The key features of this package -->
* Enables the use of C# async iterators on older .NET platforms
## How to Use
<!-- A compelling example on how to use this package with code, as well as any specific guidelines for when to use the package -->
```C#
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
internal static class Program
{
private static async Task Main()
{
Console.WriteLine("Starting...");
await foreach (var value in GetValuesAsync())
{
Console.WriteLine(value);
}
Console.WriteLine("Finished!");
static async IAsyncEnumerable<int> GetValuesAsync()
{
for (int i = 0; i < 10; i++)
{
await Task.Delay(TimeSpan.FromSeconds(1));
yield return i;
}
}
}
}
```
## Main Types
<!-- The main types provided in this library -->
The main types provided by this library are:
* `IAsyncEnumerable<T>`
* `IAsyncEnumerator<T>`
* `IAsyncDisposable<T>`
## Additional Documentation
<!-- Links to further documentation. Remove conceptual documentation if not available for the library. -->
* [C# Feature Specification](https://learn.microsoft.com/dotnet/csharp/language-reference/proposals/csharp-8.0/async-streams)
* [Walkthrough article](https://learn.microsoft.com/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8)
## Feedback & Contributing
<!-- How to provide feedback on this package and contribute to it -->
Microsoft.Bcl.AsyncInterfaces is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime).
\ No newline at end of file
<Project InitialTargets="NETStandardCompatError_Microsoft_Bcl_AsyncInterfaces_net462">
<Target Name="NETStandardCompatError_Microsoft_Bcl_AsyncInterfaces_net462"
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
<Warning Text="Microsoft.Bcl.AsyncInterfaces 9.0.0 doesn't support $(TargetFramework) and has not been tested with it. Consider upgrading your TargetFramework to net462 or later. You may also set &lt;SuppressTfmSupportBuildWarnings&gt;true&lt;/SuppressTfmSupportBuildWarnings&gt; in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk." />
</Target>
</Project>
<?xml version="1.0"?>
<doc>
<assembly>
<name>Microsoft.Bcl.AsyncInterfaces</name>
</assembly>
<members>
<member name="T:System.Runtime.InteropServices.LibraryImportAttribute">
<summary>
Attribute used to indicate a source generator should create a function for marshalling
arguments instead of relying on the runtime to generate an equivalent marshalling function at run-time.
</summary>
<remarks>
This attribute is meaningless if the source generator associated with it is not enabled.
The current built-in source generator only supports C# and only supplies an implementation when
applied to static, partial, non-generic methods.
</remarks>
</member>
<member name="M:System.Runtime.InteropServices.LibraryImportAttribute.#ctor(System.String)">
<summary>
Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.LibraryImportAttribute"/>.
</summary>
<param name="libraryName">Name of the library containing the import.</param>
</member>
<member name="P:System.Runtime.InteropServices.LibraryImportAttribute.LibraryName">
<summary>
Gets the name of the library containing the import.
</summary>
</member>
<member name="P:System.Runtime.InteropServices.LibraryImportAttribute.EntryPoint">
<summary>
Gets or sets the name of the entry point to be called.
</summary>
</member>
<member name="P:System.Runtime.InteropServices.LibraryImportAttribute.StringMarshalling">
<summary>
Gets or sets how to marshal string arguments to the method.
</summary>
<remarks>
If this field is set to a value other than <see cref="F:System.Runtime.InteropServices.StringMarshalling.Custom" />,
<see cref="P:System.Runtime.InteropServices.LibraryImportAttribute.StringMarshallingCustomType" /> must not be specified.
</remarks>
</member>
<member name="P:System.Runtime.InteropServices.LibraryImportAttribute.StringMarshallingCustomType">
<summary>
Gets or sets the <see cref="T:System.Type"/> used to control how string arguments to the method are marshalled.
</summary>
<remarks>
If this field is specified, <see cref="P:System.Runtime.InteropServices.LibraryImportAttribute.StringMarshalling" /> must not be specified
or must be set to <see cref="F:System.Runtime.InteropServices.StringMarshalling.Custom" />.
</remarks>
</member>
<member name="P:System.Runtime.InteropServices.LibraryImportAttribute.SetLastError">
<summary>
Gets or sets whether the callee sets an error (SetLastError on Windows or errno
on other platforms) before returning from the attributed method.
</summary>
</member>
<member name="T:System.Runtime.InteropServices.StringMarshalling">
<summary>
Specifies how strings should be marshalled for generated p/invokes
</summary>
</member>
<member name="F:System.Runtime.InteropServices.StringMarshalling.Custom">
<summary>
Indicates the user is supplying a specific marshaller in <see cref="P:System.Runtime.InteropServices.LibraryImportAttribute.StringMarshallingCustomType"/>.
</summary>
</member>
<member name="F:System.Runtime.InteropServices.StringMarshalling.Utf8">
<summary>
Use the platform-provided UTF-8 marshaller.
</summary>
</member>
<member name="F:System.Runtime.InteropServices.StringMarshalling.Utf16">
<summary>
Use the platform-provided UTF-16 marshaller.
</summary>
</member>
<member name="T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute">
<summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
</member>
<member name="M:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute.#ctor(System.String)">
<summary>Initializes the attribute with a field or property member.</summary>
<param name="member">
The field or property member that is promised to be not-null.
</param>
</member>
<member name="M:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute.#ctor(System.String[])">
<summary>Initializes the attribute with the list of field and property members.</summary>
<param name="members">
The list of field and property members that are promised to be not-null.
</param>
</member>
<member name="P:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute.Members">
<summary>Gets field or property member names.</summary>
</member>
<member name="T:System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute">
<summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
</member>
<member name="M:System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.#ctor(System.Boolean,System.String)">
<summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
<param name="returnValue">
The return value condition. If the method returns this value, the associated field or property member will not be null.
</param>
<param name="member">
The field or property member that is promised to be not-null.
</param>
</member>
<member name="M:System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.#ctor(System.Boolean,System.String[])">
<summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
<param name="returnValue">
The return value condition. If the method returns this value, the associated field and property members will not be null.
</param>
<param name="members">
The list of field and property members that are promised to be not-null.
</param>
</member>
<member name="P:System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.ReturnValue">
<summary>Gets the return value condition.</summary>
</member>
<member name="P:System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute.Members">
<summary>Gets field or property member names.</summary>
</member>
</members>
</doc>
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## About
<!-- A description of the package and where one can find more documentation -->
`Microsoft.Extensions.Configuration` is combined with a core configuration abstraction under `Microsoft.Extensions.Configuration.Abstractions` that allows for building different kinds of configuration providers to retrieve key/value pair configuration values from in the form of `IConfiguration`. There are a number of built-in configuration provider implementations to read from environment variables, in-memory collections, JSON, INI or XML files. Aside from the built-in variations, there are more shipped libraries shipped by community for integration with various configuration service and other data sources.
## Key Features
<!-- The key features of this package -->
* In-memory configuration provider
* Chained configuration provider for chaining multiple confiugration providers together.
* Base types that implement configuration abstraction interfaces that can be used when implementing other configuration providers.
## How to Use
<!-- A compelling example on how to use this package with code, as well as any specific guidelines for when to use the package -->
```C#
using Microsoft.Extensions.Configuration;
var configurationBuilder = new ConfigurationBuilder();
configurationBuilder.AddInMemoryCollection(
new Dictionary<string, string?>
{
["Setting1"] = "value",
["MyOptions:Enabled"] = bool.TrueString,
});
configurationBuilder.AddInMemoryCollection(
new Dictionary<string, string?>
{
["Setting2"] = "value2",
["MyOptions:Enabled"] = bool.FalseString,
});
var config = configurationBuilder.Build();
// note case-insensitive
Console.WriteLine(config["setting1"]);
Console.WriteLine(config["setting2"]);
// note last in wins
Console.WriteLine(config["MyOptions:Enabled"]);
```
## Main Types
<!-- The main types provided in this library -->
The main types provided by this library are:
* `Microsoft.Extensions.Configuration.ConfigurationBuilder`
* `Microsoft.Extensions.Configuration.ConfigurationManager`
* `Microsoft.Extensions.Configuration.ConfigurationRoot`
* `Microsoft.Extensions.Configuration.ConfigurationSection`
## Additional Documentation
<!-- Links to further documentation -->
- [Configuration in .NET](https://learn.microsoft.com/dotnet/core/extensions/configuration)
- [Microsoft.Extensions.Configuration namespace](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration)
## Related Packages
<!-- The related packages associated with this package -->
* [Microsoft.Extensions.Configuration.Binder](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Binder)
* [Microsoft.Extensions.Configuration.CommandLine](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.CommandLine)
* [Microsoft.Extensions.Configuration.EnvironmentVariables](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.EnvironmentVariables)
* [Microsoft.Extensions.Configuration.FileExtensions](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.FileExtensions)
* [Microsoft.Extensions.Configuration.Ini](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Ini)
* [Microsoft.Extensions.Configuration.Json](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Json)
* [Microsoft.Extensions.Configuration.UserSecrets](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.UserSecrets)
* [Microsoft.Extensions.Configuration.Xml](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Xml)
## Feedback & Contributing
<!-- How to provide feedback on this package and contribute to it -->
Microsoft.Extensions.Configuration is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime).
<Project InitialTargets="NETStandardCompatError_Microsoft_Extensions_Configuration_Abstractions_net8_0"> <Project InitialTargets="NETStandardCompatError_Microsoft_Extensions_Configuration_net462">
<Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_Abstractions_net8_0" <Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_net462"
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''"> Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
<Warning Text="Microsoft.Extensions.Configuration.Abstractions 9.0.0 doesn't support $(TargetFramework) and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set &lt;SuppressTfmSupportBuildWarnings&gt;true&lt;/SuppressTfmSupportBuildWarnings&gt; in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk." /> <Warning Text="Microsoft.Extensions.Configuration 9.0.0 doesn't support $(TargetFramework) and has not been tested with it. Consider upgrading your TargetFramework to net462 or later. You may also set &lt;SuppressTfmSupportBuildWarnings&gt;true&lt;/SuppressTfmSupportBuildWarnings&gt; in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk." />
</Target> </Target>
</Project> </Project>
<Project InitialTargets="NETStandardCompatError_Microsoft_Extensions_Configuration_FileExtensions_net462"> <Project InitialTargets="NETStandardCompatError_Microsoft_Extensions_Configuration_net8_0">
<Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_FileExtensions_net462" <Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_net8_0"
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''"> Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
<Warning Text="Microsoft.Extensions.Configuration.FileExtensions 9.0.0 doesn't support $(TargetFramework) and has not been tested with it. Consider upgrading your TargetFramework to net462 or later. You may also set &lt;SuppressTfmSupportBuildWarnings&gt;true&lt;/SuppressTfmSupportBuildWarnings&gt; in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk." /> <Warning Text="Microsoft.Extensions.Configuration 9.0.0 doesn't support $(TargetFramework) and has not been tested with it. Consider upgrading your TargetFramework to net8.0 or later. You may also set &lt;SuppressTfmSupportBuildWarnings&gt;true&lt;/SuppressTfmSupportBuildWarnings&gt; in the project file to ignore this warning and attempt to run in this unsupported configuration at your own risk." />
</Target> </Target>
</Project> </Project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment