> For the complete documentation index, see [llms.txt](https://aptivi.gitbook.io/deprecated/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aptivi.gitbook.io/deprecated/inxi.net-manual/usage/how-to-use.md).

# How to use

Using this library is very simple! Just use the `Inxi.NET` namespace in any piece of code you want to use the library, as in: `using InxiFrontend;`

In order to get hardware information, just invoke the `Inxi` constructor when assigning a new variable that holds hardware information. For example,

```csharp
var InxiInstance = new InxiFrontend.Inxi();
```

This gets all hardware information from your computer, assuming that you have the following files installed on your Linux computer:

* `/usr/bin/inxi`
  * Can be obtained by installing Inxi using your favorite package manager (usually `inxi`)
* `/usr/bin/cpanel_json_xs`
  * Can be obtained by installing CPanel Json Perl Module using your favorite package manager (usually `libcpanel-json-xs-perl`)
* `/usr/bin/json_xs`
  * Can be obtained by installing Json Perl Module using your favorite package manager (usually `libjson-xs-perl`)

In order to selectively parse the computer hardware information, you can use the constructor that lets you set the hardware type to be parse:

```csharp
var InxiInstance = new InxiFrontend.Inxi(InxiHardwareType.type);
```

where `type` is:

* `InxiHardwareType.BIOS`
* `InxiHardwareType.Graphics`
* `InxiHardwareType.HardDrive`
* `InxiHardwareType.HardDriveLogical`
* `InxiHardwareType.Machine`
* `InxiHardwareType.Network`
* `InxiHardwareType.PCMemory`
* `InxiHardwareType.Processor`
* `InxiHardwareType.Sound`
* `InxiHardwareType.System`
* `InxiHardwareType.Battery`

Very rarely, if your system doesn't have the above paths to required programs (either you've compiled Json Perl modules using CPAN, or you've downloaded Inxi straight from its source code, or you've got both), you can supply the paths to the three different paths by invoking the third version of the constructor:

```csharp
var InxiInstance = new InxiFrontend.Inxi("path/to/inxi", "path/to/cpanel_json_xs", "path/to/json_xs", InxiHardwareType.type);
```

You can then use the `InxiInstance.Hardware` class to obtain info about your computer's hardware.

For debugging, listen to the `DebugDataReceived` event by adding the event handler to it, for example:

```csharp
InxiTrace.DebugDataReceived += HandleDebugData;
```

If you're going to use functions, you must implement the function with the following signature (function name can be changed):

```csharp
private static void HandleDebugData(string Message, string PlainMessage)
    => Console.WriteLine(Message);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aptivi.gitbook.io/deprecated/inxi.net-manual/usage/how-to-use.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
