Sunday, February 24, 2008

HID Communication in asp.net with c#

HIDLibrary.dll
namespace:using HIDLbrary;
namespace:using System.Text;
protected void btnsend_click(object sender, EventArgs e)
{
HIDLibrary.HidDevic[] HidDeviceList;
HidDevice HidDevice ;
HidDeviceList=HidDevices.Enumerate(0x01234,0x00001);
if(HidDeviceList.Length>0)
{
HidDevice=HidDeviceList[1];
byte[] Outdata=new byte[HidDevice.Capabilities.OutputReportByteLength-1];
HidDevice.OpenDevice();
OutData[0]=Convert.ToByte(txtsend.Text);
HidReport hr=new HidReport(1);
hr.Data=OutData;
HidDevice.WriteReport(hr);
HidDevice.Write(OutData);
string Text;
hr=HidDevice.ReadReport();
Text=Convert.ToString(hr.Data.GetValue(0));
txtread.Text=Text;
}

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...