Ketamine Kyle
Ketamine Kyle
CC#
Created by Ketamine Kyle on 1/20/2024 in #help
✅ Trying to send message to a specific user in signalR but javascript is just not recieving the data
Trying to send message to a specific user in signalR but javascript is just not recieving the data I provided my code in the codeshare and briefly explained what it does the main problem is just that the javascript does not recieve the data Ive checked to make sure that finding the username works I have a function which checks and it matches the username to the connectionID https://codeshare.io/QnPxn7
29 replies
CC#
Created by Ketamine Kyle on 1/7/2024 in #help
ASP.NET How to return a view and filecontents
I CANT FIGURE THIS OUT MAN WHAT THE HELL Current code
[HttpPost]
[Route("Builder/ZaBuildor")]
public IActionResult Build(BuilderViewModel bvm)
{
try
{
DragonSim.Builder.Build.Compile(bvm);
var filePath = Path.Combine(Paths.BuildPath, bvm.Filename + ".bat");
var fileBytes = System.IO.File.ReadAllBytes(filePath);
var fileContentResult = File(fileBytes, "application/octet-stream", bvm.Filename + ".bat");

return Json(new { success = true, message = "Build successful", fileContent = Convert.ToBase64String(fileBytes) });
}
catch (Exception ex)
{
return Json(new { success = false, message = "Error building stub: " + ex.Message });
}
finally
{
System.IO.File.Delete(Path.Combine(Paths.BuildPath, bvm.Filename + ".bat"));
System.IO.File.Delete(Path.Combine(Paths.BuildPath, "DragonSim.exe"));
}
}
[HttpPost]
[Route("Builder/ZaBuildor")]
public IActionResult Build(BuilderViewModel bvm)
{
try
{
DragonSim.Builder.Build.Compile(bvm);
var filePath = Path.Combine(Paths.BuildPath, bvm.Filename + ".bat");
var fileBytes = System.IO.File.ReadAllBytes(filePath);
var fileContentResult = File(fileBytes, "application/octet-stream", bvm.Filename + ".bat");

return Json(new { success = true, message = "Build successful", fileContent = Convert.ToBase64String(fileBytes) });
}
catch (Exception ex)
{
return Json(new { success = false, message = "Error building stub: " + ex.Message });
}
finally
{
System.IO.File.Delete(Path.Combine(Paths.BuildPath, bvm.Filename + ".bat"));
System.IO.File.Delete(Path.Combine(Paths.BuildPath, "DragonSim.exe"));
}
}
56 replies
CC#
Created by Ketamine Kyle on 12/29/2023 in #help
Updating Html Table when data is added to mongo db
I am making a asp.net core mvc application and I wanna add data to my table every time a entry is added to my mongodb? I have tried using SignalR but it wont work? any ideas on how I could do it
29 replies