C# client SocketIoClientDotNet.Client is not work(node server) - c#

C# WinForms client:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Quobject.SocketIoClientDotNet.Client;
namespace socket_TEST
{
#nullable enable
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
connect();
}
public void connect()
{
var socket = IO.Socket("http://127.0.0.1:3000/");
socket.On(Socket.EVENT_CONNECT, () =>
{
MessageBox.Show("connection!");
});
socket.On("connection", () =>
{
MessageBox.Show("connection!");
});
}
}
}
Nodejs server:
const app=require('express')();
const server=require('http').Server(app);
const io=require('socket.io')(server);
io.sockets.on("connection",function(socket){
console.log("new client");
});
server.listen(3000,function(){
console.log("------SERVER RUNNING------");
});
I want to connect C# and Nodejs servers.
But the connection is still not working. Can you tell me why and how should I solve it?

i see SocketIoClientDotNet THIS PROJECT IS DEPRECATED

Related

Win32 Exception: 0xc0000005 | dll injection

So today I tried dll injection to game (assult cube) to test my experience with my job.
But I got problems with Win32 Exception: 0xc0000005.
My code looks like:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Memory;
namespace AssultCube_Cheat
{
public partial class Form1 : Form
{
Mem assultcube = new Mem();
public static string RifleAmmo = "ac_client.exe+0x0017E0A8";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int PID = assultcube.GetProcIdFromName("ac_client");
if (PID > 0)
{
assultcube.OpenProcess(PID);
Thread WA = new Thread(writeAmmo) { IsBackground = true };
WA.Start();
}
}
private void writeAmmo()
{
while (true)
{
if (checkBox1.Checked)
{
assultcube.WriteMemory(RifleAmmo, "int", "80");
Thread.Sleep(2);
}
Thread.Sleep(2);
}
}
}
}
I tried updating my computer drivers, upgrading my system to Windows 11 but problem didnt fix.

C# Signalr - An error occured while sending the request

So I'm trying out SignalR, for this project I'm doing. And I don't really understand the .WithUrl paramater in HubConnectionBuilder. How do I know which URL to specify, if I want to host on localhost?
My HUB:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR;
namespace SignalRChat.MyHub
{
public class MyHub : Hub
{
public async Task SendMessage(string user, string message)
{
await Clients.All.SendAsync("SendMessage", user, message);
}
}
}
My program.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNetCore.Cors.Infrastructure;
using Microsoft.AspNetCore.SignalR.Client;
using Owin;
using SignalRChat.MyHub;
using Microsoft.Owin.Hosting;
using Microsoft.Owin.Cors;
namespace SignalRChat
{
public partial class Form1 : Form
{
HubConnection connection;
public Form1()
{
InitializeComponent();
connection = new HubConnectionBuilder()
.WithUrl("http://localhost:8080/MyHub")
.Build();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private async void button1_Click(object sender, EventArgs e)
{
try
{
await connection.StartAsync();
//await connection.InvokeAsync("SendMessage", textBox1.Text, textBox2.Text);
//listBox1.Items.Add($"{textBox1.Text}: {textBox2.Text}");
}
catch (Exception ex)
{
listBox1.Items.Add(ex.Message);
}
}
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}
I'm getting the following error:
Error message/Exception
I've tried searching around the internet, about how to use the .WithUrl, but with no luck. I'm hoping that some of you guys can help a brother out!
Can you try displaying the innerException in your exception handler and see what the detailed error is?
Also, check your SignalR Event Hub (http://localhost:8080/MyHub) is running.
If your SignalR event hub is running then try debugging it and see if it receiving requests in your service hub background task.
Another thing you can check is the URL you are calling is identical to the SignalR hub route configured in your SignalR hub hub service:
routes.MapHub<MyHubClass>("/MyHub");

How to prevent the running of rename application?

With this code I can prevent a duplicate application from running the name given in the code .
But after the application is created, the name of that application (exe) can be changed and run multiple times in the same machine.
How to prevent it from running?
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Text = "Demo";
int ac = System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count();
if (ac > 1)
{
MessageBox.Show("Application Already Running");
this.Close();
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World");
}
}
}```

C# Trying to find the RobloxPlayerBeta

Here is my code: I am trying to find the roblox PlayerBeta but its not working
I am not the best in coding but I found out how to find it but cant implent it right into the code
( EDIT ) The program works if I use the PID but that changes everytime I open up a new RobloxPlayerBeta ! so I cannot use that
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Memory;
using System.Diagnostics;
namespace ForceField
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Mem MemLib = new Mem();
private void button1_Click(object sender, EventArgs e)
{
if (System.Diagnostics.Process.GetProcesses().Any((p) => p.ProcessName.Contains("RobloxPlayerBeta")))
{
int robloxPid = System.Diagnostics.Process.GetProcessesByName("RobloxPlayerBeta").FirstOrDefault().Id;
}
Console.WriteLine(robloxPid);
MemLib.writeMemory("0x184C3A98", "string", "PlsNoBan ");
Console.WriteLine(MemLib.readString("0x184C3A98"));
}
}
}
Omg I am stupid.. xD
I needed to do MemLib.OpenGameProcess(robloxPid)

Connecting VLC Plugin

I want to make stream application for RTSP cam to open VLC
when I press the button show to me the stream in the application but it doesn't show to me anything I want the program to display the stream in VLC
this the code of the application using c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace vlc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void axVLCPlugin21_Enter(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.add("rtsp://192.168.0.209:554/mpeg4", "live", "network-caching=75");
//pictureBox1.Visible = false;
axVLCPlugin21.playlist.play();
}
}
}

Categories

Resources