commit bafb0c000fabb02c54bcbbd6892ef1742ffa50b2 Author: Lncvrt Date: Wed Sep 16 16:30:21 2026 -0700 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/PasswordGenerator.slnx b/PasswordGenerator.slnx new file mode 100644 index 0000000..ee75da3 --- /dev/null +++ b/PasswordGenerator.slnx @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/PasswordGenerator/Form1.Designer.cs b/PasswordGenerator/Form1.Designer.cs new file mode 100644 index 0000000..6b25f80 --- /dev/null +++ b/PasswordGenerator/Form1.Designer.cs @@ -0,0 +1,305 @@ +using System.Drawing; + +namespace PasswordGenerator +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.TitleText = new System.Windows.Forms.Label(); + this.InfoText = new System.Windows.Forms.Label(); + this.LengthText = new System.Windows.Forms.Label(); + this.LengthSlider = new System.Windows.Forms.TrackBar(); + this.PresetLength8Button = new System.Windows.Forms.Button(); + this.PresetLength16Button = new System.Windows.Forms.Button(); + this.PresetLength32Button = new System.Windows.Forms.Button(); + this.PresetLength64Button = new System.Windows.Forms.Button(); + this.PresetLength128Button = new System.Windows.Forms.Button(); + this.CharsText = new System.Windows.Forms.Label(); + this.UppercaseCheck = new System.Windows.Forms.CheckBox(); + this.LowercaseCheck = new System.Windows.Forms.CheckBox(); + this.NumbersCheck = new System.Windows.Forms.CheckBox(); + this.SymbolsCheck = new System.Windows.Forms.CheckBox(); + this.PasswordOutput = new System.Windows.Forms.TextBox(); + this.CopyButton = new System.Windows.Forms.Button(); + this.RegenerateButton = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.LengthSlider)).BeginInit(); + this.SuspendLayout(); + // + // TitleText + // + this.TitleText.Cursor = System.Windows.Forms.Cursors.Default; + this.TitleText.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Bold); + this.TitleText.Location = new System.Drawing.Point(12, 9); + this.TitleText.Name = "TitleText"; + this.TitleText.Size = new System.Drawing.Size(360, 45); + this.TitleText.TabIndex = 0; + this.TitleText.Text = "Password Generator"; + this.TitleText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // InfoText + // + this.InfoText.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.InfoText.Location = new System.Drawing.Point(18, 54); + this.InfoText.Name = "InfoText"; + this.InfoText.Size = new System.Drawing.Size(354, 41); + this.InfoText.TabIndex = 1; + this.InfoText.Text = "Select a length, or use the slider for a custom value."; + this.InfoText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // LengthText + // + this.LengthText.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.LengthText.Location = new System.Drawing.Point(12, 95); + this.LengthText.Name = "LengthText"; + this.LengthText.Size = new System.Drawing.Size(360, 38); + this.LengthText.TabIndex = 2; + this.LengthText.Text = "Password Length: 8"; + this.LengthText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // LengthSlider + // + this.LengthSlider.LargeChange = 50; + this.LengthSlider.Location = new System.Drawing.Point(12, 136); + this.LengthSlider.Maximum = 500; + this.LengthSlider.Minimum = 1; + this.LengthSlider.Name = "LengthSlider"; + this.LengthSlider.Size = new System.Drawing.Size(360, 45); + this.LengthSlider.TabIndex = 3; + this.LengthSlider.TickFrequency = 50; + this.LengthSlider.Value = 8; + this.LengthSlider.ValueChanged += new System.EventHandler(this.LengthSlider_ValueChanged); + // + // PresetLength8Button + // + this.PresetLength8Button.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.PresetLength8Button.Location = new System.Drawing.Point(85, 187); + this.PresetLength8Button.Name = "PresetLength8Button"; + this.PresetLength8Button.Size = new System.Drawing.Size(36, 36); + this.PresetLength8Button.TabIndex = 4; + this.PresetLength8Button.Text = "8"; + this.PresetLength8Button.UseVisualStyleBackColor = true; + this.PresetLength8Button.Click += new System.EventHandler(this.PresetLength8Button_Click); + // + // PresetLength16Button + // + this.PresetLength16Button.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.PresetLength16Button.Location = new System.Drawing.Point(127, 187); + this.PresetLength16Button.Name = "PresetLength16Button"; + this.PresetLength16Button.Size = new System.Drawing.Size(36, 36); + this.PresetLength16Button.TabIndex = 5; + this.PresetLength16Button.Text = "16"; + this.PresetLength16Button.UseVisualStyleBackColor = true; + this.PresetLength16Button.Click += new System.EventHandler(this.PresetLength16Button_Click); + // + // PresetLength32Button + // + this.PresetLength32Button.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.PresetLength32Button.Location = new System.Drawing.Point(169, 187); + this.PresetLength32Button.Name = "PresetLength32Button"; + this.PresetLength32Button.Size = new System.Drawing.Size(36, 36); + this.PresetLength32Button.TabIndex = 6; + this.PresetLength32Button.Text = "32"; + this.PresetLength32Button.UseVisualStyleBackColor = true; + this.PresetLength32Button.Click += new System.EventHandler(this.PresetLength32Button_Click); + // + // PresetLength64Button + // + this.PresetLength64Button.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.PresetLength64Button.Location = new System.Drawing.Point(211, 187); + this.PresetLength64Button.Name = "PresetLength64Button"; + this.PresetLength64Button.Size = new System.Drawing.Size(36, 36); + this.PresetLength64Button.TabIndex = 7; + this.PresetLength64Button.Text = "64"; + this.PresetLength64Button.UseVisualStyleBackColor = true; + this.PresetLength64Button.Click += new System.EventHandler(this.PresetLength64Button_Click); + // + // PresetLength128Button + // + this.PresetLength128Button.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.PresetLength128Button.Location = new System.Drawing.Point(253, 187); + this.PresetLength128Button.Name = "PresetLength128Button"; + this.PresetLength128Button.Size = new System.Drawing.Size(48, 36); + this.PresetLength128Button.TabIndex = 8; + this.PresetLength128Button.Text = "128"; + this.PresetLength128Button.UseVisualStyleBackColor = true; + this.PresetLength128Button.Click += new System.EventHandler(this.PresetLength128Button_Click); + // + // CharsText + // + this.CharsText.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.CharsText.Location = new System.Drawing.Point(12, 226); + this.CharsText.Name = "CharsText"; + this.CharsText.Size = new System.Drawing.Size(360, 37); + this.CharsText.TabIndex = 9; + this.CharsText.Text = "Characters to use"; + this.CharsText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // UppercaseCheck + // + this.UppercaseCheck.Checked = true; + this.UppercaseCheck.CheckState = System.Windows.Forms.CheckState.Checked; + this.UppercaseCheck.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.UppercaseCheck.Location = new System.Drawing.Point(85, 266); + this.UppercaseCheck.Name = "UppercaseCheck"; + this.UppercaseCheck.Size = new System.Drawing.Size(117, 37); + this.UppercaseCheck.TabIndex = 11; + this.UppercaseCheck.Text = "Uppercase"; + this.UppercaseCheck.UseVisualStyleBackColor = true; + this.UppercaseCheck.CheckedChanged += new System.EventHandler(this.UppercaseCheck_CheckedChanged); + // + // LowercaseCheck + // + this.LowercaseCheck.Checked = true; + this.LowercaseCheck.CheckState = System.Windows.Forms.CheckState.Checked; + this.LowercaseCheck.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.LowercaseCheck.Location = new System.Drawing.Point(193, 266); + this.LowercaseCheck.Name = "LowercaseCheck"; + this.LowercaseCheck.Size = new System.Drawing.Size(117, 37); + this.LowercaseCheck.TabIndex = 12; + this.LowercaseCheck.Text = "Lowercase"; + this.LowercaseCheck.UseVisualStyleBackColor = true; + this.LowercaseCheck.CheckedChanged += new System.EventHandler(this.LowercaseCheck_CheckedChanged); + // + // NumbersCheck + // + this.NumbersCheck.Checked = true; + this.NumbersCheck.CheckState = System.Windows.Forms.CheckState.Checked; + this.NumbersCheck.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.NumbersCheck.Location = new System.Drawing.Point(85, 309); + this.NumbersCheck.Name = "NumbersCheck"; + this.NumbersCheck.Size = new System.Drawing.Size(117, 37); + this.NumbersCheck.TabIndex = 13; + this.NumbersCheck.Text = "Numbers"; + this.NumbersCheck.UseVisualStyleBackColor = true; + this.NumbersCheck.CheckedChanged += new System.EventHandler(this.NumbersCheck_CheckedChanged); + // + // SymbolsCheck + // + this.SymbolsCheck.Checked = true; + this.SymbolsCheck.CheckState = System.Windows.Forms.CheckState.Checked; + this.SymbolsCheck.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.SymbolsCheck.Location = new System.Drawing.Point(193, 309); + this.SymbolsCheck.Name = "SymbolsCheck"; + this.SymbolsCheck.Size = new System.Drawing.Size(117, 37); + this.SymbolsCheck.TabIndex = 14; + this.SymbolsCheck.Text = "Symbols"; + this.SymbolsCheck.UseVisualStyleBackColor = true; + this.SymbolsCheck.CheckedChanged += new System.EventHandler(this.SymbolsCheck_CheckedChanged); + // + // PasswordOutput + // + this.PasswordOutput.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.PasswordOutput.Location = new System.Drawing.Point(12, 352); + this.PasswordOutput.MaxLength = 500; + this.PasswordOutput.Multiline = true; + this.PasswordOutput.Name = "PasswordOutput"; + this.PasswordOutput.ReadOnly = true; + this.PasswordOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.PasswordOutput.Size = new System.Drawing.Size(360, 100); + this.PasswordOutput.TabIndex = 15; + this.PasswordOutput.Text = resources.GetString("PasswordOutput.Text"); + this.PasswordOutput.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // CopyButton + // + this.CopyButton.AutoSize = true; + this.CopyButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.CopyButton.Location = new System.Drawing.Point(136, 458); + this.CopyButton.Name = "CopyButton"; + this.CopyButton.Size = new System.Drawing.Size(50, 27); + this.CopyButton.TabIndex = 16; + this.CopyButton.Text = "Copy"; + this.CopyButton.UseVisualStyleBackColor = true; + // + // RegenerateButton + // + this.RegenerateButton.AutoSize = true; + this.RegenerateButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); + this.RegenerateButton.Location = new System.Drawing.Point(192, 458); + this.RegenerateButton.Name = "RegenerateButton"; + this.RegenerateButton.Size = new System.Drawing.Size(93, 27); + this.RegenerateButton.TabIndex = 17; + this.RegenerateButton.Text = "Regenerate"; + this.RegenerateButton.UseVisualStyleBackColor = true; + this.RegenerateButton.Click += new System.EventHandler(this.RegenerateButton_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 496); + this.Controls.Add(this.RegenerateButton); + this.Controls.Add(this.CopyButton); + this.Controls.Add(this.PasswordOutput); + this.Controls.Add(this.SymbolsCheck); + this.Controls.Add(this.NumbersCheck); + this.Controls.Add(this.LowercaseCheck); + this.Controls.Add(this.UppercaseCheck); + this.Controls.Add(this.CharsText); + this.Controls.Add(this.PresetLength128Button); + this.Controls.Add(this.PresetLength64Button); + this.Controls.Add(this.PresetLength32Button); + this.Controls.Add(this.PresetLength16Button); + this.Controls.Add(this.PresetLength8Button); + this.Controls.Add(this.LengthSlider); + this.Controls.Add(this.LengthText); + this.Controls.Add(this.InfoText); + this.Controls.Add(this.TitleText); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "Form1"; + this.Text = "Password Generator"; + ((System.ComponentModel.ISupportInitialize)(this.LengthSlider)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label TitleText; + private System.Windows.Forms.Label InfoText; + private System.Windows.Forms.Label LengthText; + private System.Windows.Forms.TrackBar LengthSlider; + private System.Windows.Forms.Button PresetLength8Button; + private System.Windows.Forms.Button PresetLength16Button; + private System.Windows.Forms.Button PresetLength32Button; + private System.Windows.Forms.Button PresetLength64Button; + private System.Windows.Forms.Button PresetLength128Button; + private System.Windows.Forms.Label CharsText; + private System.Windows.Forms.CheckBox UppercaseCheck; + private System.Windows.Forms.CheckBox LowercaseCheck; + private System.Windows.Forms.CheckBox NumbersCheck; + private System.Windows.Forms.CheckBox SymbolsCheck; + private System.Windows.Forms.TextBox PasswordOutput; + private System.Windows.Forms.Button CopyButton; + private System.Windows.Forms.Button RegenerateButton; + } +} + diff --git a/PasswordGenerator/Form1.cs b/PasswordGenerator/Form1.cs new file mode 100644 index 0000000..bcb85f6 --- /dev/null +++ b/PasswordGenerator/Form1.cs @@ -0,0 +1,68 @@ +using System; +using System.Text; +using System.Windows.Forms; + +namespace PasswordGenerator +{ + public partial class Form1 : Form + { + const string charsUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const string charsLower = "abcdefghijklmnopqrstuvwxyz"; + const string charsNumber = "0123456789"; + const string charsSymbols = "!@#$%^&*"; + private bool _loaded = false; + + public Form1() + { + InitializeComponent(); + + _loaded = true; + GeneratePassword(); + } + + public void GeneratePassword() + { + string chars = + (UppercaseCheck.Checked ? charsUpper : "") + + (LowercaseCheck.Checked ? charsLower : "") + + (NumbersCheck.Checked ? charsNumber : "") + + (SymbolsCheck.Checked ? charsSymbols : ""); + + if (chars == "") { PasswordOutput.Text = ""; return; } + + StringBuilder password = new StringBuilder(); + Random random = new Random(); + + for (int i = 0; i < LengthSlider.Value; i++) + { + password.Append(chars[random.Next(chars.Length)]); + } + + PasswordOutput.Text = password.ToString(); + } + + private void LengthSlider_ValueChanged(object sender, System.EventArgs e) + { + if (!_loaded) return; + + LengthText.Text = $"Password Length: {LengthSlider.Value}"; + GeneratePassword(); + } + + private void CopyButton_Click(object sender, System.EventArgs e) + { + Clipboard.SetText(PasswordOutput.Text); + } + + private void RegenerateButton_Click(object sender, System.EventArgs e) => GeneratePassword(); + private void UppercaseCheck_CheckedChanged(object sender, EventArgs e) => GeneratePassword(); + private void LowercaseCheck_CheckedChanged(object sender, EventArgs e) => GeneratePassword(); + private void NumbersCheck_CheckedChanged(object sender, EventArgs e) => GeneratePassword(); + private void SymbolsCheck_CheckedChanged(object sender, EventArgs e) => GeneratePassword(); + private void PresetLength8Button_Click(object sender, System.EventArgs e) => LengthSlider.Value = 8; + private void PresetLength16Button_Click(object sender, System.EventArgs e) => LengthSlider.Value = 16; + private void PresetLength32Button_Click(object sender, System.EventArgs e) => LengthSlider.Value = 32; + private void PresetLength64Button_Click(object sender, System.EventArgs e) => LengthSlider.Value = 64; + private void PresetLength128Button_Click(object sender, System.EventArgs e) => LengthSlider.Value = 128; + } +} diff --git a/PasswordGenerator/Form1.resx b/PasswordGenerator/Form1.resx new file mode 100644 index 0000000..0c917a3 --- /dev/null +++ b/PasswordGenerator/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + #cvMu*qtIf47Jy@EnhcAhNjD5cxEFu8onVaoS2WYx0Nd4rA#r*W!H8HFgYpH1a3KzMra#a$xllzF5bZVSs@yA!#r28Iakc8agpW0zcRH!zcczQ0^jbQ^vSJL4^lQvW5@tosBWZZ0UW23kgyrBQAd9ZmFKJCL1#j%a7573dhVIWUQX6$BYINxb45^TOVPvL17iXKPfKHWrCynYYyOsYAlaNMmYo9Kr08Hb01T8YI524aF^ngyC^&*7qJkXZ6QOGZaPD1DAdhkx4KgtfAFKCGXBfV@$BH%fLI#9fDv@sd#G5TwH&F%3L!cWjpUyNzJ2YWtv*pwcF#o@WZMg7PI*!fohtmHI5VB0f#vh4kHff6bAZG9ROvj5JWf#C0akkk!v&kU2^S%X7$QuUKItcH%ujgMfghWv#M1UP@#E59pF1x9LJ9Nz67ic!@GDUOqdl*Zbm6c7&p13GuDkdsI5YSCVqnE0^o3i^5^ZabVMlw3IaRRG8NagP8BTap$ + + \ No newline at end of file diff --git a/PasswordGenerator/PasswordGenerator.csproj b/PasswordGenerator/PasswordGenerator.csproj new file mode 100644 index 0000000..29b77c9 --- /dev/null +++ b/PasswordGenerator/PasswordGenerator.csproj @@ -0,0 +1,110 @@ + + + + + Debug + AnyCPU + {A5BB7E69-CD32-4642-A11E-FEE43765903A} + WinExe + PasswordGenerator + PasswordGenerator + v2.0 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + 7.3 + prompt + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + 7.3 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + 7.3 + prompt + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + \ No newline at end of file diff --git a/PasswordGenerator/Program.cs b/PasswordGenerator/Program.cs new file mode 100644 index 0000000..6a9d4b3 --- /dev/null +++ b/PasswordGenerator/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace PasswordGenerator +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/PasswordGenerator/Properties/AssemblyInfo.cs b/PasswordGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bb35493 --- /dev/null +++ b/PasswordGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PasswordGenerator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PasswordGenerator")] +[assembly: AssemblyCopyright("Copyright © 2026")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a5bb7e69-cd32-4642-a11e-fee43765903a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PasswordGenerator/Properties/Resources.Designer.cs b/PasswordGenerator/Properties/Resources.Designer.cs new file mode 100644 index 0000000..c7ab26c --- /dev/null +++ b/PasswordGenerator/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PasswordGenerator.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PasswordGenerator.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/PasswordGenerator/Properties/Resources.resx b/PasswordGenerator/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/PasswordGenerator/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PasswordGenerator/Properties/Settings.Designer.cs b/PasswordGenerator/Properties/Settings.Designer.cs new file mode 100644 index 0000000..fa0c395 --- /dev/null +++ b/PasswordGenerator/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PasswordGenerator.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/PasswordGenerator/Properties/Settings.settings b/PasswordGenerator/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/PasswordGenerator/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + +