Questions tagged [.net]

.NET is a software framework supporting a multi-language paradigm and supporting language interoperability. .NET applications are executed in a virtual machine (CLR) which provides a few important services: security, memory management and exception handling.

70 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
194 views

.NET DLL Injector in C++

I built a DLL Injector with User-Interface. The program lists all processes, the user chooses one of them and a DLL, and inject it. It's my first project in C++, and I know it's not exactly C++ ...
5
votes
0answers
176 views

WebPage LogReader class - Parallel DNS w/timeout for computer IP's and domains from log scrape

This is a namespace to read a bunch of events from a log file and display them in a table on a webpage, some additional data (computer domain and IP address) is also pulled in from DNS. I am mostly ...
4
votes
0answers
371 views

Custom TaskScheduler: Limited concurrency level

I'm interested in some feedback for a custom TaskScheduler implementation I wrote today for use on a game server - I wanted to be able to have a single-threaded scheduler for tasks since the game is ...
4
votes
0answers
136 views

Comparing two instances of a class

I have a Calculation class. It is persisted in the DB and users can modify it. The aim of the CompareWith function is to ...
3
votes
0answers
56 views

Java code to convert BigDecimal to/from .NET decimal

Background In many languages we have built-in data types for representing decimal floating point numbers. In .NET that's decimal, and in Java we have ...
3
votes
0answers
250 views

Deserializing JSON with Utf8JsonReader

Path of Exile is a PC game where players can list their items for sale. The game has a public API that serves JSON which contains all of these items. My application consumes that JSON and indexes the ...
3
votes
0answers
46 views

Generic object-to-XML mapper

This code is part of a larger mapping library I'm working on to address some business concerns of transforming data. I was inspired by mapstruct in Java, but opted for users to annotate / add ...
3
votes
0answers
32 views

Validating a collection of proxy servers with maximum possible throughput

I am validating a collection of proxy servers and trying to achieve the maximum possible throughput. I've tested a few different methods, such as Task.WhenAll, TPL ...
3
votes
1answer
153 views

Object pooling in WPF

In a WPF project I'm working on, often multiple objects reuse the same AnimationTimeline, to smooth that out I made an ...
3
votes
0answers
658 views

Navigate to three pages in parallel with Selenium, ChromeDriver, and NUnit

As an experiment, I've created an NUnit test project that should, when running all tests, open three browser windows simultaneously, and each should load a particular page before closing. My question ...
3
votes
0answers
63 views

Enabling parents and dependencies of selected items recursively

I have a class Feature as such: ...
3
votes
0answers
388 views

Event-driven UDP listener wrapper

I wrote this wrapper around the UdpClient,using events for new datagrams: ...
3
votes
0answers
89 views

Calculate compilation time from AssemblyVersion attribute

In my program, I display the compilation time which is calculated from the AssemblyVersion attribute. The attribute is set to automatically generate a version ...
3
votes
1answer
4k views

Checking if a directory exists in FTP without relying on exception handling

I've written a method to check if a directory already exists on an FTP server. The only way I could see to make this work was to return a different result from the method if an exception is thrown - ...
2
votes
0answers
161 views

Server app: pinging up to 500 clients asynchronyosly

TCP/IP server which controls up to 500 clients. There's a list of added computers and the server gets this list, selects computers which are not already connected and ping them using host name. ...
2
votes
0answers
571 views

Parsing XML file from the REST API

Please suggest how I can improve my code (like memory leakage, which pattern to use etc.). I have to parse a book XML in two ways: first from an FTP file and second from the REST API. I implemented ...
2
votes
0answers
62 views

Convert Simple C# Console>Service to perform repeated API calls and file system actions

I was sent here from StackOverflow, as it was indicated that the quality of my current approach may have been questionable. I'm attempting to transform a simple console application so that it may be ...
2
votes
0answers
219 views

Console shutdown mechanism

I'm trying to create an effiecent way to shut down my console application. To do this I have a while loop in my program's main method waiting for a request to shutdown. ...
2
votes
0answers
884 views

Entity Framework with two databases (with UoW, Repository and Service Layer)

I have two databases: one for a warehouse, second for the office (The db design is out of the scope of this question). There are MANY cross-database funtions. One of those functions is ...
2
votes
0answers
228 views

Customizable Blockchain's block structure

I'm creating a new open-source blockchain framework for .NET Core and .NET Standard. But I have some questions about how to make block structure to be customizable and look beautiful. Let's begin ...
2
votes
0answers
303 views

Extension methods with reusable logic - passing Action to Func<TResponse>

I have several extension methods for interacting with the Google Calendar API, and these all use an ExecuteWithRetry function for wrapping API calls within retry ...
2
votes
0answers
910 views

Adding support of HTTP PATCH

I have an API endpoint to modify a race car, which supports the PUT method: PUT /api/racecars/{racecarId} Since PUT must be ...
2
votes
0answers
491 views

C# FileSystemWatcher Manager with Debounce

For a class last fall I was working on a "cloud backup" system. Originally in Pascal, I decided to rewrite it in C# and expand the feature set. Below is the FileSystemWatcher "manager" class which ...
2
votes
0answers
71 views

REST API design to handle status migrations

I have a requirement to provide an API which would allow to change status of Order. The API is supposed to follow REST principles, so I have designed an endpoint ...
2
votes
0answers
48 views

Updating Excel sheet with information from a DataTable

Basically, I'm trying to update an excel sheet using a DataTable (The columns structure between the two are not the same) with respect to the following rules: ...
2
votes
0answers
2k views

Generic repository and generic service

I use the Repository/Service design pattern in my projects. I have doubts whether it is worth using common services BaseEntity: ...
2
votes
0answers
513 views

Hashing a SecureString in C#

In .NET, the SecureString type exists to prevent leaking secrets in memory. I want to create a hash from the contents of a SecureString, without putting the contents in memory in a place where I can't ...
2
votes
0answers
69 views

LightsOut - A homework framework for teaching CS to non-engineers

This provides a fill-in-the-blanks homework framework to implement the game "LightsOut". LightsOut is a game with a grid of lights. When you touch a light, it toggles it’s state; it ALSO toggles the ...
2
votes
0answers
177 views

Estimate π using an infinite series

Looking for style and speed review π PI An estimate is \$\frac{4}{1} - \frac{4}{3} + \frac{4}{5} - \frac{4}{7} + \frac{4}{9} - \frac{4}{11} + \frac{4}{13} - \frac{4}{15} + \frac{4}{17} \$... The ...
2
votes
0answers
69 views

Script testing a PDF making server

The script tests a server rendering PDFs. The server is running as a Windows service. The script does the following: Prepare the test configure server export script variables to xml copy input Run ...
2
votes
0answers
39 views

Creating an Excel sheet and appending namings for a matrix

I'm working on some VB.Net code to generate data sheets for giving user rights on a per folder level. I came up with this code but it's very slow and I feel like it could be improved. ...
2
votes
0answers
26 views

Validate User By Comparing against SQL Data

I'm currently building a Windows Form Application using Visual Studio 2015 and the Visual Basic.NET programming language. On the main form there is a Tab Control and an ActiveX PDf viewer control. ...
2
votes
0answers
390 views

Implementation of custom config section

i recently wrote my first custom config section. I have a collection of index files, each has a path and a savetime: ...
2
votes
0answers
422 views

Add transactional Units of Work to incorrect NHibernate usage (microsessions, single object actions)

This code is part of a quite huge repository using NHibernate in a wrong way: no units of work, but microsessions for every object loading and saving (ignorant of Persistence Ignorance, coded like ...
2
votes
0answers
1k views

Are there pitfalls to this solution to read messages from a queue in parallel?

I've posted a question on stackoverflow: How can I consequently read messages from a queue in parallel? I would like my own answer to be reviewed. Situation We have one message queue. We would like ...
2
votes
0answers
198 views

Safely aborting thrid-party code using TPL

I'm using some third-party libraries in my project. Once in a while the code in these libraries freaks out and produces infinite loops and other nasty things. My goal is to write a wrapper that allows ...
2
votes
0answers
884 views

Update Virtual Property in a Code First Model using Independent Association in Entity Framework 6

I have a Model that looks like this: ...
1
vote
0answers
78 views

An arithmetic operation app in C#

One of my friends was creating an app with following requirements and having been someone with slightly more coding experience, I wanted to help: Create a calculator that does one arithmetic ...
1
vote
0answers
131 views

SemaphoreSlim extension method for safely handling cancellation and disposal

I have often found myself using a try {semaphore.Wait()} finally {semaphore.Release()} pattern when using semaphores, so decided I wanted to try and write an ...
1
vote
0answers
37 views

Iterating over combinations

Background The following describes the real world problem that my code is intended to solve. It is may help you understand what the code is doing and why. I don't think this is strictly necessary in ...
1
vote
0answers
189 views

Convert video to GIF using ffMPEG

Looking for the best way to speed up or maybe move from FFMpegConverter to another application for converting video to GIF, because it takes much time, will be much ...
1
vote
0answers
71 views

Simple json config provider

I'm pretty new to this so constructive criticism is acceptable. I'm trying to find any way I can improve this system, all it does is take a string, determine if that string is a web address or a file ...
1
vote
0answers
547 views

Secure password hashing implementation with salt and pepper

I share below my password hashing implementation with salt and pepper in C#, for your review and feedback. In my implementation methods like ValidatePassword(), ChangePassword() are in the user class. ...
1
vote
0answers
42 views

Wrapping third-party component to use in windows service

I'm using a third-party commercial server component to listen for SAP IDocs. I want to run the server inside a windows service and the vendor recommends having a separate method to check the server ...
1
vote
0answers
62 views

Tiny app to track working time on Jira tickets

I'm a .NET intern. For my project management we work with Jira and we have to track real working time on a ticket to log the work and compare it to the original estimate. For this purpose I have ...
1
vote
0answers
82 views

Thread-safe hashset that enumerates according to insertion order

According to the .NET documentation, HashSet<T> does not maintain order when enumerated so I implemented my own using F#. Can anyone help review if this is ...
1
vote
0answers
1k views

Cancel running Task on Dispose and race condition

I'm building a wrapper around NamedPipeServerStream and NamedPipeClientStream. Currently my ...
1
vote
0answers
173 views

RSA Encryption, improving programming practice and code quality?

This was my first go at any kind of encryption in any kind of programming aspect but my application needed some kind of RSA end encryption for my game packets. Uses RSA and diffihelman and runs off 3 ...
1
vote
0answers
79 views

C#: Foreach vs Seperate Threads?

Each 'Room' class instance needs to call the method 'ProcessRoom'. I am currently overthinking something and would like another persons opinion. One of the constant things here is ProcessRoom gets ...
1
vote
0answers
65 views

Task/Thread/Timer Dilema

I'm looking to improve the performance, quality and effiency of the following code. I have a server I use for my game that manages all the players connected plus a few other things, which have Manager ...