Windows forms App
Im am a begginer in c# and i am using visual studio 2022 i find a problem when i use windows forms using entity famework. if i use windows forms app (.NET Framework) i find this problem and when i use windows forms app i find this…
Create a PS Cmdlet in c# that opens a PSSession and outputs session
Hi Guys, I'm trying to create a PS Cmdlet in C# that will Creaet a PS-Session (Runspace?) and output the Ps-Session to the user. i am able to establish a connection in c# but i can't figure out how to pass it to PowerShell? (i assume i need to output a…
Service permissions to query or execute WMI commands on local machine.
I have a device I plug into a USB port which shows as a composite device in Windows, one of which is a network adapter. I am writing a service to detect this adapter and assign a static IP to it. I'm using WMI to do this, in \root\CIMV2, finding the…
Performance problem in C#
I have a code-module in C#, which contains a loop with math. operations. At the end of each execution of the loop I get the UTC-time in milliseconds and store this by writeline() in a protocol-file (for example 200 lines at all). When the code-module is…
Why it's taking 17-18 seconds to download image ? each time it's taking 17-18 seconds.
The class Radar using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Extract { class Radar { public List<string> links = new List<string>(); …
I copy a unit test in c#. However an error is found.
Dear All, I copy a unit test in c# from YouTube (https://www.youtube.com/watch?v=HYrXogLj7vg). See the screen captures. Could anybody tell me how to fix it?
Index of control is -1 in C#
Hi, I am trying to get the index of a textbox control in WinForms, so I am using this: var index = Controls.IndexOf(textBox24); MessageBox.Show(index.ToString()); Now when I run the app, and click on the textbox, it shows the index as -1. Why?…
Get the ElementFromPoint (IUIAutomation) from the 2nd scaled monitor
Hello, I'm getting the wrong IUIAutomation element from the 2nd monitor, if use it in a browser window like edge (which is not the main monitor and has a dpi for i.e. 125% in the windows settings.) I tried a few things and can't find a working…
Marshaling list string from C++ to C#
Hi guys, now i studying the way to marshalling list string in struct from C++ to C#. The structure of struct same like: In C++: struct A { wchar_t Name[24][16]; } in C#: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] …
i can not connect mail server using tcpclient
i build a form to connect the mail servers using tcpclient withn port 25 but it does not start connecting to mail server any help please the problem in this code TcpClient connectserver = new TcpClient(); …
Check if that DataBase is exist.
Hi All, What to do; Check if name of database is exist every time to create.Bellow some code I'm trying. Thank using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using…
I created a slider bar user control but at run time when I move the slider to the left or right why it's not getting to the end or swallow?
In the user control designer I added a pictureBox control : Then in the code I did : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using…
How to submit selections to download file
Is it possible to write C# code to make selections i.e. date range to download a file? You can't see any of the controls under view source.
How to create RunAndSave Assembly using System.Reflection.Emit in .NET 6?
In the .NET 6 documentation for the AssemblyBuilder class in System.Reflection.Emit there is an example of how to build an assembly. The example can be made to compile and work in .NET 6 by changing AssemblyBuilder ab =…
How to get original data before decryption ?
I work on csharp I need to get data before decryption but i don't know how to do that data decrypted on file as below : ˆU*o" ى,be~ùث »وچٍاàےي¾أ(هشْé Pشم¢×l. ZS’ى² N· ¾«é¬Q غتُ ’ذi,اGNِء”©¢¼î¨C2‡ ùu35Yôy ¾إ ً¼@پ6¹qv¹آœإûج 4 Hu؟¼إ‘{]…J î‚üد*ڈ…
missing logic to the LINQ query which does not work
public IHttpActionResult InsuranceLimit(InsuranceLimitDTO IL) { var result = from b in db.InsuranceTransferAcc where b.UserId == IL.UserId select b.CreatedDate; } This above query (result ) is returning me empty. Not understanding what I am…
Is it ok to use HttpRequestMessage.properties in .net core 3.1?
Hi, I'm using HttpRequestMessage properties property in order to pass auth type in the request so that the message habdler will generate the correct authorization heade (basic, jwt, etc...) Is it good approach? Another thing I saw the Properties…
A general class to manage threads
Dear All, I am a beginner in C#. I want to create a class which can insert into any project for managing threads. However I don't know how to do it. Could anybody help me?
How do I set DBF column value to NULL (blank) when using VFPOLEDB and C#?
I have created a WPF application that is to maintain existing DBF files. These files are also used by another legacy application so I cannot migrate the data to SQL server or other more current DB. Some of the DBF tables have columns whose values are not…
LINQ Query for checking Time duration
I have a sql table which has column as below I want to have a LINQ query to check, when InsuranceID is passed as a input parameter, the logic needs to check for that particular InsuranceID if the CreationDate is >24 hrs return as True else return…