I made an license key system in Win-forms (C# Visual Studio) I run into an error when executing the code. Want to see the source code? see it here on github:
GitHub License key system C#
Pictures of the errors:
Visual Studio
Exe Error
Exe Error details
[!] The project is inspired by an License key system with the .WPF framework (Works fine on the .WPF Framework). I try'd to convert it to .NET because my app is written in C# .NET
Line of code that gives the error:
using (StreamReader reader = new StreamReader(stream))
(in QP_Helpers.cs line 38)
This code gets the license code from any source
string LicenseKeys = new System.Net.WebClient() { Proxy = null }.DownloadString("https://pastebin.com/X0m6avV6");
The license keys are encrypted. The License Key in this program is =
Test
Debug:
Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Details:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. **** Exception Text System.Argument Null Exception: Value cannot be null. Parameter name: stream at System.I0.StreamReader.ctor(Stream stream, Encoding encoding. Boolean dete at System. IO.StreamReader..ctor(Stream stream) at QP _Helpers.QP_Helpers. IsLicensed (String key, String resourceName) in C: \User at LicenseKey.NET buy btn_register _Click (Object sender, Event Args e)
What I have tried:
I try'd to give
using (StreamReader reader = new StreamReader(stream))
an diffrent value, (this value needs to be zero)