Auxiliary 1.0.0

dotnet add package Auxiliary --version 1.0.0
NuGet\Install-Package Auxiliary -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Auxiliary" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Auxiliary --version 1.0.0
#r "nuget: Auxiliary, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Auxiliary as a Cake Addin
#addin nuget:?package=Auxiliary&version=1.0.0

// Install Auxiliary as a Cake Tool
#tool nuget:?package=Auxiliary&version=1.0.0

Auxiliary

Scanner class
Read the following parameters from Scanner---Symbol DS6708 Barcode Scanner
    // check if all barcode 输入是否完毕  {EOT}
    If (Asc(e.KeyChar) == 4)                                     
    {

       // decode the keychar
        var scanner = New Auxiliary.Scanner(_myKeyCode)        
        
      // get the value of Partnumber, Quantity, LotCode and DateCode
        var Partnumber     = scanner.getPartNumber().Trim()         
        var quantity     = scanner.getQuantity
        var lotcode     = scanner.getLotCode
        var datecode     = scanner.getDateCode()
    
                                           
    }

RestApi

Calling api with RestSharp and WebClient easily
  • Send()

Send your request with RestSharp

⇒ Parameters : string baseUrl, string functionName, Method method, IDictionary<string, string> headers, IDictionary<string, object> parametersBody, string userName, string password

⇒ Return: IRestResponse

IDictionary<string, object> body = new Dictionary<string, object>();

body.Add("action", action);

body.Add("CellNumber", phoneNumber);



IDictionary<string, string> header = new Dictionary<string, string>();

header.Add("content-type", "application/json;charset=UTF-8");



string output = AuxiliaryLibraries.AuxiliaryRestApi.Send(url, header, body, "POST");

var responseDTO = JsonConvert.DeserializeObject<ResponseDTO>(output);
  • Send()

Send your request with RestSharp

⇒ Parameters : string baseUrl, string functionName, Method method, IDictionary<string, string> headers, object body, string userName, string password

⇒ Return: IRestResponse

IDictionary<string, object> body = new Dictionary<string, object>();

body.Add("action", action);

body.Add("CellNumber", phoneNumber);



IDictionary<string, string> header = new Dictionary<string, string>();

header.Add("content-type", "application/json;charset=UTF-8");



string output = AuxiliaryLibraries.AuxiliaryRestApi.Send(url, header, body, "POST");

var responseDTO = JsonConvert.DeserializeObject<ResponseDTO>(output);
  • Send()

Send your request with WebClient

⇒ Parameters : string url, IDictionary<string, string> headers, IDictionary<string, object> parametersBody, string method = "GET", bool contentLength = true

⇒ Return: string

IDictionary<string, object> body = new Dictionary<string, object>();

body.Add("action", action);

body.Add("CellNumber", phoneNumber);



IDictionary<string, string> header = new Dictionary<string, string>();

header.Add("content-type", "application/json;charset=UTF-8");



string output = AuxiliaryLibraries.AuxiliaryRestApi.Send(url, header, body, "POST");

var responseDTO = JsonConvert.DeserializeObject<ResponseDTO>(output);

Zip

create a zip file of the files provided
  • Compress()

Create a ZIP file of the files provided.

⇒ Parameters : IEnumerable< string > fileNames, string destinationFileName

⇒ Return: void

  • Compress()

Compress entire folder by passing directory Path

⇒ Parameters : string directoryPath

⇒ Return: void

  • Decompress()

Decompress *.zip file, if pathIsDirectory pass as false. (One Zip file)

Decompress every *.zip files inside filder by passing directory Path, if pathIsDirectory pass as true. (Multiple Zip files)

⇒ Parameters : string path, bool pathIsDirectory = false

⇒ Return: void

  • Decompress()

Decompress *.zip file by passing FileInfo

If you pass newFileName, the zip file extracted on this path,

otherwise it (if you pass newFileName as null, default value) the zip file extracted on the parent folder

⇒ Parameters : System.IO.FileInfo fileToDecompress, string newFileName = null

⇒ Return: void

Queue

it is a new data type
  • Push()

push a object to a generic list

  • Pop()

pop a object out from a generic list

ObjectCopier class
Provides a method for performing a deep copy of an object
  • Clone()

Perform a deep copy of the object via serialization.

Be careful, The type must be serializable.

⇒ Parameters : T source

⇒ Return: T

var person = new Person();

var clonedPerson = person.Clone();

Logger class

Logger helps you to log texts, to a *.log file
  • void Log(this Exception ex, string path = "")

  • void Log(this string text, string path = "")

  • void LogToNewFile(this string text, string path = "")

  • string Read(this string path)

IniFile class

read/Write/Delete a string from a specified section in IniFile
  • ReadString(string section, string key)

  • ReadBoolean(string section, string key)

  • ReadDecimal(string section, string key)

  • ReadDouble(string section, string key)

  • ReadFloat(string section, string key)

  • ReadInteger(string section, string key)

  • ReadDate(string section, string key)

  • ReadDateTime(string section, string)

  • WriteString(string section, string key, string value)

  • WriteBoolean(string section, string key, bool value)

  • WriteDecimal(string section, string key, decimal value)

  • WriteDouble(string section, string key, double value)

  • WriteFloat(string section, string key, float value)

  • WriteInteger(string section, string key, integer value)

  • WriteDate(string section, string key, date value)

  • WriteDateTime(string section, string, datetime value)

  • bool SectionExists(string section)

  • bool KeyExists(string section, string key)

  • void DeleteKey(string section, string key)

  • void DeleteSection(string section)

DirectoryFileHelper class
it is a collection of direcotry operation, Createfolder, copyFolder
  • CreateFolderIfNeeded()

Create a folder if it doesn't exist

⇒ Parameters : string path

⇒ Return: bool

AuxiliaryDirectoryFileHelper.CreateFolderIfNeeded("C:/My Folder");
  • CopyFolder()

Copy a Folder (including every files and sub folders in it) from 'sourcePath' to 'destinationPath'

⇒ Parameters : string sourcePath, string destinationPath

⇒ Return: bool

AuxiliaryDirectoryFileHelper.CopyFolder("C:/My Folder1", "C:/My Folder2");
  • CopyFile()

Copy a File from 'sourcePath' to 'destinationPath'

⇒ Parameters : string sourcePath, string destinationPath

⇒ Return: bool

AuxiliaryDirectoryFileHelper.CopyFile("C:/My Folder1/image.jpg", "C:/My Folder2/image.jpg");
  • Download()

Download a file by its 'url' and save it to 'destination'

⇒ Parameters : string url, string destination

⇒ Return: bool

AuxiliaryDirectoryFileHelper.Download("https://google.com/1.jpg", "C:/My Folder1/image.jpg");
  • IsImage()

Undrasting this file is image or not

⇒ Parameters : string contentType

⇒ Return: bool

AuxiliaryDirectoryFileHelper.IsImage("C:/My Folder1", "C:/My Folder2");
  • GetMimeTypeFromFilePath()

Get Mime Type From File Path

⇒ Parameters : string filePath

⇒ Return: string

AuxiliaryDirectoryFileHelper.GetMimeTypeFromFilePath("C:/My Folder1/image.jpg");
  • GetMimeTypeFromFilePath()

Get Mime Type From File Format

⇒ Parameters : string format

⇒ Return: string

AuxiliaryDirectoryFileHelper.GetMimeTypeFromFilePath(".jpg");

IpAddress class

IpAddress helps you to work with IPs
  • IsInRange()

Return true, if ip is in the range of lowerRange and upperRange

⇒ Parameters : IPAddress ip, IPAddress lowerRange, IPAddress upperRange

⇒ Return: bool

Product Compatible and additional computed target framework versions.
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 398 8/17/2022
1.0.0-a 131 8/16/2022

MIT License