Xeno-rat
Loading...
Searching...
No Matches
xeno_rat_server.Forms.Shell Class Reference
Inheritance diagram for xeno_rat_server.Forms.Shell:
Collaboration diagram for xeno_rat_server.Forms.Shell:

Public Member Functions

 Shell (Node _client)
 
async Task RecvThread ()
 Asynchronously receives data from the connected client and updates the UI with the received data.
 

Protected Member Functions

override void Dispose (bool disposing)
 Releases the unmanaged resources used by the component and optionally releases the managed resources.
 

Private Member Functions

void Shell_Load (object sender, EventArgs e)
 Event handler for the form load event.
 
async void button1_Click (object sender, EventArgs e)
 Clears the text in textBox1 and sends a byte array with value 1 using the client asynchronously.
 
async void button2_Click (object sender, EventArgs e)
 Clears the text in the textBox and sends an asynchronous message to the client with the byte value 2.
 
async void button3_Click (object sender, EventArgs e)
 Sends a byte array with value 0 followed by the UTF-8 encoded text from textBox2 using the client .
 
void textBox2_KeyDown (object sender, KeyEventArgs e)
 Handles the KeyDown event for textBox2. If the Enter key is pressed, it triggers the click event for button3 and suppresses the key press.
 
void textBox1_VisibleChanged (object sender, EventArgs e)
 Sets the cursor position to the end of the text and scrolls the text box to ensure the cursor is visible when the text box becomes visible.
 
void InitializeComponent ()
 Initializes the components of the form including buttons, text boxes, and event handlers.
 

Private Attributes

Node client
 
System.ComponentModel.IContainer components = null
 Required designer variable.
 
System.Windows.Forms.Button button1
 
System.Windows.Forms.Button button2
 
System.Windows.Forms.TextBox textBox1
 
System.Windows.Forms.Button button3
 
System.Windows.Forms.TextBox textBox2
 

Constructor & Destructor Documentation

◆ Shell()

xeno_rat_server.Forms.Shell.Shell ( Node _client)
inline
Here is the call graph for this function:

Member Function Documentation

◆ button1_Click()

async void xeno_rat_server.Forms.Shell.button1_Click ( object sender,
EventArgs e )
inlineprivate

Clears the text in textBox1 and sends a byte array with value 1 using the client asynchronously.

Parameters
senderThe object that raised the event.
eThe event data.

This method clears the text in textBox1 and then sends a byte array with value 1 using the client asynchronously.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ button2_Click()

async void xeno_rat_server.Forms.Shell.button2_Click ( object sender,
EventArgs e )
inlineprivate

Clears the text in the textBox and sends an asynchronous message to the client with the byte value 2.

Parameters
senderThe object that raised the event.
eThe event data.

This method clears the text in the textBox and then sends an asynchronous message to the client using the SendAsync method of the client object. The message sent contains a byte value of 2.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ button3_Click()

async void xeno_rat_server.Forms.Shell.button3_Click ( object sender,
EventArgs e )
inlineprivate

Sends a byte array with value 0 followed by the UTF-8 encoded text from textBox2 using the client .

Parameters
senderThe object that raised the event.
eThe event data.

This method asynchronously sends a byte array with value 0 followed by the UTF-8 encoded text from textBox2 using the client . After sending, the text in textBox2 is cleared.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose()

override void xeno_rat_server.Forms.Shell.Dispose ( bool disposing)
inlineprotected

Releases the unmanaged resources used by the component and optionally releases the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

This method releases the unmanaged resources used by the component and optionally releases the managed resources. If disposing is true, this method disposes of the managed resources.

◆ InitializeComponent()

void xeno_rat_server.Forms.Shell.InitializeComponent ( )
inlineprivate

Initializes the components of the form including buttons, text boxes, and event handlers.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecvThread()

async Task xeno_rat_server.Forms.Shell.RecvThread ( )
inline

Asynchronously receives data from the connected client and updates the UI with the received data.

This method continuously listens for incoming data from the connected client using asynchronous operations. When data is received, it is decoded from bytes to a string using UTF-8 encoding and appended to the text box in the UI, followed by a new line. The method runs until the client is disconnected or an error occurs.

Exceptions
InvalidOperationExceptionThrown when the client is not in a connected state.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Shell_Load()

void xeno_rat_server.Forms.Shell.Shell_Load ( object sender,
EventArgs e )
inlineprivate

Event handler for the form load event.

Parameters
senderThe object that raised the event.
eThe event data.
Here is the caller graph for this function:

◆ textBox1_VisibleChanged()

void xeno_rat_server.Forms.Shell.textBox1_VisibleChanged ( object sender,
EventArgs e )
inlineprivate

Sets the cursor position to the end of the text and scrolls the text box to ensure the cursor is visible when the text box becomes visible.

Parameters
senderThe object that raised the event.
eThe event data.
Exceptions
System.InvalidOperationExceptionThrown when the text box is not in a valid state for the operation.
Here is the caller graph for this function:

◆ textBox2_KeyDown()

void xeno_rat_server.Forms.Shell.textBox2_KeyDown ( object sender,
KeyEventArgs e )
inlineprivate

Handles the KeyDown event for textBox2. If the Enter key is pressed, it triggers the click event for button3 and suppresses the key press.

Parameters
senderThe object that raised the event.
eA KeyEventArgs that contains the event data.

This method checks if the Enter key is pressed and, if so, triggers the click event for button3 and suppresses the key press to prevent further processing of the Enter key.

Here is the caller graph for this function:

Member Data Documentation

◆ button1

System.Windows.Forms.Button xeno_rat_server.Forms.Shell.button1
private

◆ button2

System.Windows.Forms.Button xeno_rat_server.Forms.Shell.button2
private

◆ button3

System.Windows.Forms.Button xeno_rat_server.Forms.Shell.button3
private

◆ client

Node xeno_rat_server.Forms.Shell.client
private

◆ components

System.ComponentModel.IContainer xeno_rat_server.Forms.Shell.components = null
private

Required designer variable.

◆ textBox1

System.Windows.Forms.TextBox xeno_rat_server.Forms.Shell.textBox1
private

◆ textBox2

System.Windows.Forms.TextBox xeno_rat_server.Forms.Shell.textBox2
private

The documentation for this class was generated from the following files: