# Read file

![](/files/fQJWYZF09d1qnO1jci4e)

Element that reads the content file.

![](/files/ZkT7B1kiLQsxgKHvS6UJ)

Properties

\- Path\*: \[String] Path to a file to be read (c:\folder\file.txt)

\- Variable (text): \[String] Variable that receives text data from a file

\- Variable (array): \[byte\[]] Variable that accepts binary data in a file

\- Variable (image): \[System.Drawing.Bitmap] Variable that accepts image data from a file

\- Encoding: \[String] Encoding used in a file (utf-8) '<https://docs.microsoft.com/ru-ru/dotnet/api/system.text.encoding>'

```
C#
string txt = System.IO.File.ReadAllText(@"C:\text.txt");
byte[] bytes = System.IO.File.ReadAllBytes(@"C:\bytes.txt");

Python
txt = System.IO.File.ReadAllText("C:\\text.txt")
bytes = System.IO.File.ReadAllBytes("C:\\bytes.txt")

JavaScript
var txt = _lib.System.IO.File.ReadAllText("C:\\text.txt");
var bytes = _lib.System.IO.File.ReadAllBytes("C:\\bytes.txt");
```


---

# Agent Instructions: 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://astro-rpa.gitbook.io/astro-rpa-user-guide/g_elements/el_basic/els_files/el_files_readfile.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.
