Skip to content

C#

C# discussions

This category can be followed from the open social web via the handle c-065f1d12@forum.codeproject.com

93.7k Topics 383.1k Posts
  • How to generate pdf files on C#??

    csharp tutorial question
    4
    0 Votes
    4 Posts
    38 Views
    M
    I've been exploring different options for PDF generation in C# lately. Came across an interesting tool called ZetPDF.com while doing some research.
  • Win Forms, WPF, WinUI 3

    question csharp delphi wpf winforms
    3
    0 Votes
    3 Posts
    29 Views
    realJSOPR
    I started programming before OWL existed (my first IDE was Turbo Pascal for CP/M on an Apple //e back in the early 80's). I went through Pascal (OWL), C++ (MFC), and then C# (WinForms, and currently WPF). I refuse to code for WinUI, simply because I have no desire to learn it. It took me a while to accept WPF (and I fought it HARD), but I find it easy to do (easier than WinForms in a lot of ways). I do all of my design work in the XAML editor (you can drag from the Toolbox pane to the XAML to get a new control on the page, and intellisense guides you when you start changing properties in the XAML, so it's not TOO bad). After two years away from desktop apps, I spent the last weekend doing a WPF version (proof of concept) of our web app from work, and the hardest part was making the app allow the user to adjust font size with Ctrl+ and Ctrl- like a web browser (we have to comply with Section 508 by allowing the font in an application to be increased by up to 200%). A few years ago, I wrote a custom message box library that allows the developer to specify text size and custom colors (among other features), and with a little tweaking, my message boxes use the increased font size. ".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
  • System.Security.Cryptography.Aes Class

    security csharp com cryptography json
    7
    0 Votes
    7 Posts
    53 Views
    Richard DeemingR
    The variable names and string in your example suggest you are trying to encrypt a password. That is almost always the wrong thing to do. If you're trying to write an authentication system, you should be storing a salted hash of the users' passwords, using a unique salt per record, and multiple iterations of a cryptographically-secure one-way hash. There is no way to "decrypt" the password; instead, you use the stored salt and repeat the hashing operation on the entered password, then compare it to the stored hash. Secure Password Authentication Explained Simply[^] Salted Password Hashing - Doing it Right[^] If instead you're trying to store passwords or access keys for third-party systems, where you actually need to retrieve the original password, then you need to consider how you're going to store the encryption keys securely; how you're going to rotate them to minimize the impact if one is leaked; any many other complex issues. For example, you seem to be using a fixed IV for every value you encrypt, which is not secure. "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Creating a shortcut (LNK)

    csharp dotnet tools question
    4
    0 Votes
    4 Posts
    23 Views
    D
    Huh. You can try clearing the component caches. Quit VS and open the C:\Users\xxxx\AppData\Local\Microsoft\VisualStudio\_version_\ComponentModelCache folder and kill everything in it. Restart VS and see what happens. If that doesn't work, there's a cache folder for Roslyn too at C:\Users\xxxx\AppData\Local\Microsoft\VisualStudio\Roslyn. Wipe that one out too. Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak
  • PageAsyncTask with Multiple Page Requests

    csharp dotnet tutorial
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • 0 Votes
    2 Posts
    18 Views
    OriginalGriffO
    You have already asked this in Quick Answers. Don't post the same question in two places - all you will do is duplicate work and annoy people. Pick either the C# forum or the Q&A and stick with it. Annoyed people are less likely to be helpful than happy ones... "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • I want to display both Old and New Values in Form2.

    help
    3
    0 Votes
    3 Posts
    22 Views
    OriginalGriffO
    OK, that's not too bad if you handle it right. Add a property to Form2 to take the value. In the property setter, set the old values column. Then go to Form1 and open the PIN form using ShowDialog - that means that Form1 will be "frozen" until the user closes the PIN form. Now create an instance of Form2 and store it in a class level variable. Handle the Form2.FormClosed event, and clear that variable to null in the handler. Display Forms2 using the Show method. In the Save button handler, check the variable: if it is null, do nothing. Otherwise, use the property to set the new value(s). Sounds complicated, but it's pretty simple when you get your head around it. "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • Video Merging with Xabe.FFmpeg. How to track the progress?

    tutorial question
    3
    0 Votes
    3 Posts
    29 Views
    A
    You can use the 'OnProgress' event - ffmpeg Documentation[^] To add a progress tracker using a percentage, add the following to your code - textBox_taskMsg.Text = "Task is being performed.. This may take some time."; string[] files = { textBox_Source1.Text, textBox_Source2.Text }; string output = textBox_Source1.Text + "_merged.mp4"; var conversion = await FFmpeg.Conversions.FromSnippet.Concatenate(output, files) .OnProgress += (sender, args) => { //Calculate and display the progress as a percentage to your uswer... double progressPercentage = args.Percent; textBox_taskMsg.Text = $"Merging... {progressPercentage:F2}% complete"; }; await conversion.Start(); textBox_taskMsg.Text = "Merge Complete.";
  • 0 Votes
    1 Posts
    6 Views
    No one has replied
  • Video Merging using Splicer Lib

    tutorial mobile data-structures help question
    5
    0 Votes
    5 Posts
    34 Views
    OriginalGriffO
    Check the bitrate on the result file from wondershare (windows explorer will show you that) and use VLC to check the codecs the result file contains - H265 for example is a lot more compact than H264 for example, but not everything can read it. But as Dave said, that one would appear to be abandoned - and that may be because it was never finished, or had bugs, or ... you never know. You know you can splice files directly using FFMPEG as an external process? Concatenate – FFmpeg[^] "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • Crystal Reports is generating very poor HTML output

    html question
    7
    0 Votes
    7 Posts
    53 Views
    Richard DeemingR
    NB: That is a commercial product, starting at $599 per developer. Given the eight year break in messages, and the recent flurry of very similar messages, I'm starting to suspect your account has been taken over by a spammer. :suss: "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • Connecting To SharePoint Very Slow

    help sharepoint sysadmin debugging tutorial
    2
    0 Votes
    2 Posts
    18 Views
    P
    Use Fiddler[^] to check the traffic you are sending out on the first call. My suspicion is that the slow first call is because it's trying to hit the msoid endpoints, which don't exist so you are waiting for the connections to time out. The next call knows that these don't exist so it avoids them. The fix is to change your hosts file to set these connections to your loopback address so that fails straightaway. Fiddler will identify what these domains are for you. Advanced TypeScript Programming Projects
  • Save an SSRS Report in html format.

    html sql-server
    5
    0 Votes
    5 Posts
    41 Views
    P
    Thank you that was very helpful.
  • Security Considerations of Markdown in an Blazor WASM

    help question html css asp-net
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Toggle HDR mode in C#?

    csharp game-dev question
    4
    0 Votes
    4 Posts
    28 Views
    M
    Hello OriginalGriff, Thank you for taking the time to reply. Best regards, MC
  • New fangled extension methods

    data-structures question
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • Nuget Dependency Problem (NServiceBus)

    help visual-studio tutorial question
    13
    0 Votes
    13 Posts
    82 Views
    J
    Richard MacCutchan wrote: relevant to VS either From the post "when I then pull my internal nuget into a project," I figured that mean using a project via VS. One can manage them outside of VS but I doubt many people do. Certainly I would presume that most do it in VS so that is how I read it.
  • Having trouble opening a registry key

    csharp dotnet windows-admin
    7
    0 Votes
    7 Posts
    56 Views
    OriginalGriffO
    That was the original idea: a single centralized depository for all config info. So it grew and grew, and bloated massively, slowed down everything and became a source of problems because there was no defined (or enforceable) separation of App A info from App B, much less system related info. It also added a route by which trojans could inject themselves into other apps very simply by modifying the config info. So it became depreciated as a centralized store for new apps because of the problems it caused, and security features evolved as UAC was introduced which deliberately made it harder to use. Those continue to become more restrictive as the OS evolves - at some point it will probably become off limits to all non-admin apps (it's only not at present for backward compatibility with legacy applications). If it had been designed as a sandbox environment in the first place, it could have been a really useful secure store - but it never was and that lack of foresight shows in the zombie version we currently have! :D "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
  • 0 Votes
    4 Posts
    30 Views
    J
    Many of what you'd probably think of as common to .NET dependencies are out there in various forms. Dependency chaining has changed a little bit though. Mostly for the better. For the most part, transients can now be consumed without a direct reference and very little effort. If you have a nuget that then has as a dependency and you are already including that original nuget package, you do not generally also need a direct package reference in there... dotnet build will just figure that all out. (Assuming packagereference, but don't do packages.config anymore, ever)
  • Global using?

    csharp c++ com tools question
    3
    0 Votes
    3 Posts
    16 Views
    J
    Yeah I'm not a fan. I'm not even all that wild about the namespace MyNameSpace; vs namespace MyNameSpace { } but mostly just because it breaks the code if someone happens to not be on more recent tooling.