infernus8349
infernus8349
CC#
Created by infernus8349 on 3/6/2023 in #help
❔ Some bug i guess
Code that works
Task.Run(() => Static_class_name.START(param1, param2, param3));
Task.Run(() => Static_class_name.START(param1, param2, param3));
*inside the static class Static_class_name *
public static Task START(decimal param1, decimal param2, int param3)
{}
public static Task START(decimal param1, decimal param2, int param3)
{}
But i want to send more paramters like extra 3 string params which makes the function not want to run Code that does not work
Task.Run(() => Keyboard_and_Mouse.START(param1, param2, param3, param4, param5, param6));
Task.Run(() => Keyboard_and_Mouse.START(param1, param2, param3, param4, param5, param6));
*inside the static class Static_class_name *
public static Task START(decimal param1, decimal param2, int param3, string param4, string param5, string param6)
{}
public static Task START(decimal param1, decimal param2, int param3, string param4, string param5, string param6)
{}
A small modification in the code for Task.Run() that does not work
var t1 = param4;
var t2 = param5;
var t3 = param6;
Task.Run(() => Keyboard_and_Mouse.START(param1, param2, param3, t1, t2, t3));
var t1 = param4;
var t2 = param5;
var t3 = param6;
Task.Run(() => Keyboard_and_Mouse.START(param1, param2, param3, t1, t2, t3));
Now this will work and then function would run anyone got any suggestions? I will be open to live stream if needed for a better understanding. It does not make sense that when i put the values param4, 5, 6 directly to the function call, it does not run but when i put it in another variable and then put the variable in the function parameters, it works. (NOTE : all the parameters are coming from windows form application) param1 -> itemA_numericupdown.value param2 -> itemB_numericupdown.value param3 -> itemB_numericupdown.DecimalPlaces param4 -> itemC_combobox.Text param5 -> itemD_combobox.Text param6 -> itemE_combobox.Text
46 replies
CC#
Created by infernus8349 on 3/6/2023 in #help
❔ Keyboard hook
How to get all keys pressed anywhere in windows (like globally just like how a keylogger would work) WITHOUT USING A WINDOWS FORM. Like if we just start a simple .net core console application, how to do this? I cannot find the answer to this anywhere in the internet.
22 replies
CC#
Created by infernus8349 on 12/25/2022 in #help
❔ System.Reflection
So I got a dll file that contains a class and its interface. What I want is to extract the class as an item than an instance. So for example, if I have a dynamic variable of name "temp" and I wish to put the class which I extracted from dll by looping over GetExportedTypes() of the particular Assembly and putting value into "temp" when I get the preferred class, I want to be able to use it like temp instance_of_clas = new temp(); like that, is that possible? if so, how to do it? if not, is there any alternative method (other than using Activator.CreateInstance()). My aim is not to get the instance, my aim is to get the class in such a way that I can create an instance using it.
15 replies
CC#
Created by infernus8349 on 12/25/2022 in #help
❔ IP addresses
If our local pc have like DHCP, another layer of WLAN (given by ISP) and the ISP has their own IP. So if i want to ping my friend's pc, how is that possible?
9 replies
CC#
Created by infernus8349 on 12/8/2022 in #help
❔ DbContext
Can i use this in a non-asp area like for example, a simple program to make few tables using DbSet
22 replies
CC#
Created by infernus8349 on 12/7/2022 in #help
❔ RestApi
how can i return List<class> in the function Get() in Controller when i do, i get an error it says "This XML file does not appear to have any style information associated with it." i am putting my WebApiConfig file code
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
I am a beginner in API field and idk anything about front end.
33 replies
CC#
Created by infernus8349 on 11/29/2022 in #help
✅ ThreadPooling
How to release the ram used by the Thread pooling after the execution. It created like 42 threads at the starting of the program and then it reduced to 21 while execution is still moving on and when its done, the number of threads change to 10. But the problem is that the ram used by this process is at 1.4GB ram but those are not getting reduced as the threads in Thread pool reduces. How to release this memory?
243 replies