guinness Posted February 9, 2014 Share Posted February 9, 2014 So I just started with C# about 3/4 weeks ago, so it's still relatively new to me. As I enjoy a challenge I went ahead and converted my UDF >PasswordValid to a C# class, using pretty much the same idea I had for the UDF. What do I want from you? Feedback, criticism, ideas or just good old praise. Note: I opted for using the field accessors as properties to get/set instead of using public instance variables (is that correct terminology?), as I read it's bad practice to do so and just makes a ton of sense not to. I also tried to adhere to the best practices of C#, but probably messed up somewhere in the code. Anyway enjoy. expandcollapse popupusing System; using System.Text.RegularExpressions; namespace PasswordValid { internal class Program { private static void Main() { PasswordValid PW1 = new PasswordValid(); // Create a PasswordValid object. // Set the following properties. PW1.Ints = 2; // Must contain 2 integers. PW1.Length = 6; // Must contain a minimum of 6 characters. PW1.LowerCase = 2; // Must contain at least 2 lowercase characters. PW1.AllowConsecutive = false; // Disallow consecutive characters e.g. the S in password. string password = "4u0"; // Check the following password. Console.WriteLine("The following password : {0} returned {1}.", password, PW1.Validate(password)); // Returns True or False. PW1.OutputErrors(); // Display the errors found. Console.WriteLine(""); // Blank line. password = "thisPas5w0rd"; // Check the following password. Console.WriteLine("The following password : {0} returned {1}.", password, PW1.Validate(password)); // Returns True or False. PW1.OutputErrors(); // Display the errors found. PW1 = null; // Destroy the PasswordValid object. } } internal class PasswordValid // Based on code I created with AutoIt: http://www.autoitscript.com/forum/topic/153018-passwordvalid-udf-like-example-of-validating-a-password/ { // Declare and assign instance variables with their default values. private bool isConsecutive = false, isSpace = false; private int iExtended = 0, iInts = 0, ilength = 0, iLowercase = 0, iSpecial = 0, iUppercase = 0; // An enumeration list of flags for which validation checks failed. private enum flags { none = 0x00, consecutive = 0x01, ints = 0x02, length = 0x04, lowercase = 0x08, space = 0x10, special = 0x20, uppercase = 0x40 }; public PasswordValid() // Constructor - Set default values. This is just to give me an idea of how to create a constructor. { isConsecutive = true; isSpace = true; } // No DeConstructor is required in this class. public bool AllowConsecutive // Properties. This is alot cleaner than public int isConsecutive; as I don't display variable names to the end user. { get { return this.isConsecutive; } set { this.isConsecutive = value; } } public bool AllowSpace { get { return this.isSpace; } set { this.isSpace = value; } } public int Ints { get { return this.iInts; } set { this.iInts = value; } // I could add a try-catch to make sure it's an int or int.TryParse(). } public int Length { get { return this.ilength; } set { this.ilength = value; } } public int LowerCase { get { return this.iLowercase; } set { this.iLowercase = value; } } public int Special { get { return this.iSpecial; } set { this.iSpecial = value; } } public int UpperCase { get { return this.iUppercase; } set { this.iUppercase = value; } } public void OutputErrors() // Display the errors found in the password if any. { flags extendedInfo = (flags)iExtended; if (extendedInfo == flags.none) { Console.WriteLine("The password was valid."); return; // Return, as everything was OK. } if ((extendedInfo & flags.consecutive) == flags.consecutive) Console.WriteLine("The password contained repeating characters e.g. S in Password."); if ((extendedInfo & flags.ints) == flags.length) Console.WriteLine("The password didn't contain the minimum number of digits."); if ((extendedInfo & flags.length) == flags.length) Console.WriteLine("The password didn't match the miminum length."); if ((extendedInfo & flags.lowercase) == flags.lowercase) Console.WriteLine("The password didn't contain the minimum number of lowercase characters."); if ((extendedInfo & flags.space) == flags.space) Console.WriteLine("The password contained space(s)."); if ((extendedInfo & flags.special) == flags.special) Console.WriteLine("The password didn't contain the minimum number of special characters."); if ((extendedInfo & flags.uppercase) == flags.uppercase) Console.WriteLine("The password didn't contain the minimum number of uppercase characters."); return; } public bool Validate(string password) // Validate Method(). { flags extendedInfo = flags.none; // Create an enum data and set to flags.none. iExtended = (int)flags.none; // Cast flags.none to an integer, which is zero in this case. int isValid = 1; if (!this.AllowConsecutive) // Check if characters are consecutive e.g. paasword, where "aa" is invalid. { isValid = isValid * (Regex.IsMatch(password, @"(.)\1") ? 0 : 1); if (isValid == 0) extendedInfo = extendedInfo | flags.consecutive; } if (this.Ints > 0) // Check if the minimum number of integers is honoured. { isValid = isValid * (Regex.Split(password, @"\d").Length - 1 >= this.Ints ? 1 : 0); if (isValid == 0) extendedInfo = extendedInfo | flags.ints; } if (this.Length > 0) // Check if the password length is honoured. { isValid = isValid * (Regex.Split(password, @"\S").Length - 1 >= this.Length ? 1 : 0); if (isValid == 0) extendedInfo = extendedInfo | flags.length; } if (this.LowerCase > 0) // Check if the minimum number of lowercase characters is honoured. { isValid = isValid * (Regex.Split(password, @"[a-z]").Length - 1 >= this.LowerCase ? 1 : 0); if (isValid == 0) extendedInfo = extendedInfo | flags.lowercase; } if (!this.AllowSpace) // Check if whitespace is found. { isValid = isValid * (Regex.IsMatch(password, @"\s") ? 0 : 1); if (isValid == 0) extendedInfo = extendedInfo | flags.space; } /* * Special characters are: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ */ if (this.Special > 0) // Check if the minimum number of special characters is honoured. { isValid = isValid * (Regex.Split(password, @"[[:punct:]]").Length >= this.Special ? 1 : 0); if (isValid > 0) extendedInfo = extendedInfo | flags.special; } if (this.UpperCase > 0) // Check if the minimum number of uppercase characters is honoured. { isValid = isValid * (Regex.Split(password, @"[A-Z]").Length >= this.UpperCase ? 1 : 0); if (isValid > 0) extendedInfo = extendedInfo | flags.uppercase; } iExtended = (int)extendedInfo; // Cast the extendedInfo enum datatype to an int and store in extended. return isValid > 0; } } } UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 9, 2014 Share Posted February 9, 2014 The validator and results shouldn't be stored together logically. It is more common practice to return an immutable results object. For instance, instead of returning your bool and storing that goofy enum, you would return a small class or struct that has properties such as result.HasConsecutive = true. You would also have a success property on this result object like result.IsValid = false. While this isn't something wrong with your code, it will be helpful in the future: use XML comments. If you put your cursor on a line above a construct like a property or method and type ///, Visual Studio will create an XML comment field which is fed into Intellisense. It makes the popups nicer too. Link to comment Share on other sites More sharing options...
guinness Posted February 9, 2014 Author Share Posted February 9, 2014 The validator and results shouldn't be stored together logically. It is more common practice to return an immutable results objectFor instance, instead of returning your bool and storing that goofy enum, you would return a small class or struct that has properties such as result.HasConsecutive = true. You would also have a success property on this result object like result.IsValid = falseI see.While this isn't something wrong with your code, it will be helpful in the future: use XML comments. If you put your cursor on a line above a construct like a property or method and type ///, Visual Studio will create an XML comment field which is fed into Intellisense. It makes the popups nicer too.Point taken. I was just doing this out of practice.Cheers Richard for pointing me in the right direction. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted February 9, 2014 Author Share Posted February 9, 2014 I am a little perplexed (having searched around) how one would go about implementing "a returnable class". If someone could just point me in the right direction I would be grateful. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 10, 2014 Share Posted February 10, 2014 (edited) A small utility class like this would work using readonly public fields. This allows you to change them in the constructor but not class Result { public Result(bool valid, bool consecutive, etc) { IsValid = valid; HasConsecutive = consecutive; // set all the fields } public readonly bool IsValid, HasConsecutive; } And then in your validation function your return statement would look like return new Result(true, false, etc); And the etc is obviously just a place holder, you'd have real arguments. Edited February 10, 2014 by Richard Robertson Link to comment Share on other sites More sharing options...
guinness Posted February 10, 2014 Author Share Posted February 10, 2014 (edited) Brilliant! I was about to amend my previous post and ask did you want me to pass 7 arguments to the constructor and it seems you did. Thanks for putting me on the right track. Edited February 10, 2014 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted February 10, 2014 Author Share Posted February 10, 2014 expandcollapse popupusing System; using System.Text.RegularExpressions; namespace PasswordValid { internal class Program { private static void Main() { PasswordValid PW1 = new PasswordValid(); // Create a PasswordValid object. // Set the following properties. PW1.Ints = 2; // Must contain 2 integers. PW1.Length = 6; // Must contain a minimum of 6 characters. PW1.LowerCase = 2; // Must contain at least 2 lowercase characters. PW1.AllowConsecutive = false; // Disallow consecutive characters e.g. the S in password. string password = "4u0"; // Check the following password. Result PW1_Results = PW1.Validate(password); Console.WriteLine("The following password : {0} returned {1}", password, PW1_Results.IsValid); // Returns True or False. if (PW1_Results.HasConsecutive) Console.WriteLine("The password contained repeating characters e.g. S in Password."); if (PW1_Results.HasSpace) Console.WriteLine("The password contained space(s)."); if (PW1_Results.IsInts) Console.WriteLine("The password didn't contain the minimum number of digits."); if (PW1_Results.IsLength) Console.WriteLine("The password didn't match the mininum length."); if (PW1_Results.IsLowerCase) Console.WriteLine("The password didn't contain the minimum number of lowercase characters."); if (PW1_Results.IsSpecial) Console.WriteLine("The password didn't contain the minimum number of special characters."); if (PW1_Results.IsUpperCase) Console.WriteLine("The password didn't contain the minimum number of uppercase characters."); PW1 = null; // Destroy the PasswordValid object. PW1_Results = null; // Destroy the Results object. } } internal class Result // Results class. { public Result(bool isValid, bool hasAllow, bool hasSpace, bool isInts, bool isLength, bool isLowerCase, bool isSpecial, bool isUpperCase) { HasConsecutive = hasAllow; HasSpace = hasSpace; IsInts = isInts; IsLength = isLength; IsLowerCase = isLowerCase; IsSpecial = isSpecial; IsUpperCase = isUpperCase; IsValid = isValid; } public readonly bool HasConsecutive, HasSpace, IsInts, IsLength, IsLowerCase, IsSpecial, IsUpperCase, IsValid; } internal class PasswordValid // Based on code I created with AutoIt: http://www.autoitscript.com/forum/topic/153018-passwordvalid-udf-like-example-of-validating-a-password/ { // Declare and assign instance variables with their default values. private bool isConsecutive = false, isSpace = false; private int iInts = 0, ilength = 0, iLowerCase = 0, iSpecial = 0, iUpperCase = 0; // An enumeration list of flags for which validation checks failed. // private enum flags { none = 0x00, consecutive = 0x01, ints = 0x02, length = 0x04, lowercase = 0x08, space = 0x10, special = 0x20, uppercase = 0x40 }; public PasswordValid() // Constructor - Set default values. This is just to give me an idea of how to create a constructor. { isConsecutive = true; isSpace = true; } // No DeConstructor is required in this class. public bool AllowConsecutive // Properties. This is alot cleaner than public int isConsecutive; as I don't display variable names to the end user. { get { return this.isConsecutive; } set { this.isConsecutive = value; } } public bool AllowSpace { get { return this.isSpace; } set { this.isSpace = value; } } public int Ints { get { return this.iInts; } set { this.iInts = value; } // I could add a try-catch to make sure it's an int or int.TryParse(). } public int Length { get { return this.ilength; } set { this.ilength = value; } } public int LowerCase { get { return this.iLowerCase; } set { this.iLowerCase = value; } } public int Special { get { return this.iSpecial; } set { this.iSpecial = value; } } public int UpperCase { get { return this.iUpperCase; } set { this.iUpperCase = value; } } public Result Validate(string password) // Validate Method(). { int isValid = 1; bool hasConsecutive = false, hasSpace = false, isInts = false, isLength = false, isLowerCase = false, isSpecial = false, isUpperCase = false; if (!this.AllowConsecutive) // Check if characters are consecutive e.g. paasword, where "aa" is invalid. { isValid = isValid * (Regex.IsMatch(password, @"(.)\1") ? 0 : 1); hasConsecutive = (isValid == 0); } if (!this.AllowSpace) // Check if whitespace is found. { isValid = isValid * (Regex.IsMatch(password, @"\s") ? 0 : 1); hasSpace = (isValid == 0); } if (this.Ints > 0) // Check if the minimum number of integers is honoured. { isValid = isValid * (Regex.Split(password, @"\d").Length - 1 >= this.Ints ? 1 : 0); isInts = (isValid == 0); } if (this.Length > 0) // Check if the password length is honoured. { isValid = isValid * (Regex.Split(password, @"\S").Length - 1 >= this.Length ? 1 : 0); isLength = (isValid == 0); } if (this.LowerCase > 0) // Check if the minimum number of lowercase characters is honoured. { isValid = isValid * (Regex.Split(password, @"[a-z]").Length - 1 >= this.LowerCase ? 1 : 0); isLowerCase = (isValid == 0); } /* * Special characters are: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ */ if (this.Special > 0) // Check if the minimum number of special characters is honoured. { isValid = isValid * (Regex.Split(password, @"[[:punct:]]").Length >= this.Special ? 1 : 0); isSpecial = (isValid > 0); } if (this.UpperCase > 0) // Check if the minimum number of uppercase characters is honoured. { isValid = isValid * (Regex.Split(password, @"[A-Z]").Length >= this.UpperCase ? 1 : 0); isUpperCase = (isValid > 0); } return new Result(isValid > 0, hasConsecutive, hasSpace, isInts, isLength, isLowerCase, isSpecial, isUpperCase); } } } Danyfirex 1 UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 11, 2014 Share Posted February 11, 2014 Yeah that looks good. Link to comment Share on other sites More sharing options...
guinness Posted February 11, 2014 Author Share Posted February 11, 2014 Yeah that looks good. Thanks for your invaluable advice. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted February 12, 2014 Author Share Posted February 12, 2014 Final Result. (In case anyone is starting out.) expandcollapse popupusing System; using System.Text.RegularExpressions; namespace PasswordExample { internal class Program { private static void Main() { Password.Valid PW1 = new Password.Valid(); // Create a PasswordValid object. // Set the following properties. PW1.Ints = 2; // Must contain 2 integers. PW1.Length = 6; // Must contain a minimum of 6 characters. PW1.LowerCase = 2; // Must contain at least 2 lowercase characters. PW1.AllowConsecutive = false; // Disallow consecutive characters e.g. the S in password. string password = ""; // Variable to hold the password string.. Password.Errors PW1_Errors; // Declare a variable to hold the password error results. Console.WriteLine("***************************************************************************"); Console.WriteLine("| Password Validator |"); Console.WriteLine("| Build: 0.0.0.1 |"); Console.WriteLine("| |"); Console.WriteLine("| guinness 2014 |"); Console.WriteLine("| |"); Console.WriteLine("| Note: To exit the application please enter \"Exit\" (case-insensitive.) |"); Console.WriteLine("| |"); Console.WriteLine("***************************************************************************"); do { Console.Write("Password: "); password = Console.ReadLine(); PW1_Errors = PW1.Validate(password); Console.WriteLine("The following password : {0} returned {1}", password, PW1_Errors.IsValid); // Returns true or false. PrintErrorResults(PW1_Errors); // Print additional error results for the PasswordValid object. } while (password.ToLower() != "exit"); PW1 = null; // Destroy the PasswordValid object. PW1_Errors = null; // Destroy the Results object. } private static void PrintErrorResults(Password.Errors passwordResults) { Console.WriteLine(""); // Add new line. if (passwordResults.IsValid) return; // Return if the IsValid property is true as this indicated no error was created. if (passwordResults.HasConsecutive) Console.WriteLine("The password contained repeating characters e.g. S in Password."); if (passwordResults.HasSpace) Console.WriteLine("The password contained space(s)."); if (passwordResults.IsInts) Console.WriteLine("The password didn't contain the minimum number of digits."); if (passwordResults.IsLength) Console.WriteLine("The password didn't match the mininum length."); if (passwordResults.IsLowerCase) Console.WriteLine("The password didn't contain the minimum number of lowercase characters."); if (passwordResults.IsSpecial) Console.WriteLine("The password didn't contain the minimum number of special characters."); if (passwordResults.IsUpperCase) Console.WriteLine("The password didn't contain the minimum number of uppercase characters."); Console.WriteLine(""); // Add new line. return; } } } namespace Password // Password namespace. { internal class Errors // Errors class. { public Errors(bool isValid, bool hasAllow, bool hasSpace, bool isInts, bool isLength, bool isLowerCase, bool isSpecial, bool isUpperCase) { HasConsecutive = hasAllow; HasSpace = hasSpace; IsInts = isInts; IsLength = isLength; IsLowerCase = isLowerCase; IsSpecial = isSpecial; IsUpperCase = isUpperCase; IsValid = isValid; } public readonly bool HasConsecutive, HasSpace, IsInts, IsLength, IsLowerCase, IsSpecial, IsUpperCase, IsValid; } internal class Valid // Based on code I created with AutoIt: http://www.autoitscript.com/forum/topic/153018-passwordvalid-udf-like-example-of-validating-a-password/ { // Declare and assign instance variables with their default values. private bool isConsecutive = false, isSpace = false; private int iInts = 0, ilength = 0, iLowerCase = 0, iSpecial = 0, iUpperCase = 0; public Valid() // Constructor - Set default values. This is just to give me an idea of how to create a constructor. { isConsecutive = true; isSpace = true; } // No DeConstructor is required in this class. public bool AllowConsecutive // Properties. This is alot cleaner than public int isConsecutive; as it doesn't display the variable names to the end user. { get { return this.isConsecutive; } set { this.isConsecutive = value; } } public bool AllowSpace { get { return this.isSpace; } set { this.isSpace = value; } } public int Ints { get { return this.iInts; } set { this.iInts = value; } // I could add a try-catch to make sure it's an int or int.TryParse(), but this should be checked before passing to the property. } public int Length { get { return this.ilength; } set { this.ilength = value; } } public int LowerCase { get { return this.iLowerCase; } set { this.iLowerCase = value; } } public int Special { get { return this.iSpecial; } set { this.iSpecial = value; } } public int UpperCase { get { return this.iUpperCase; } set { this.iUpperCase = value; } } public Errors Validate(string password) // Validate Method(). { int isValid = 1; bool isResult = true; bool hasConsecutive = false, hasSpace = false, isInts = false, isLength = false, isLowerCase = false, isSpecial = false, isUpperCase = false; if (!this.AllowConsecutive) // Check if characters are consecutive e.g. paasword, where "aa" is invalid. { isValid = isValid * (Regex.IsMatch(password, @"(.)\1") ? 0 : 1); hasConsecutive = (isValid == 0); } if (!this.AllowSpace) // Check if whitespace is found. { hasSpace = Regex.IsMatch(password, @"\s"); isValid = isValid * (hasSpace ? 0 : 1); } if (this.Ints > 0) // Check if the minimum number of integers is honoured. { isInts = Regex.Split(password, @"\d").Length - 1 < this.Ints; isValid = isValid * (isInts ? 0 : 1); } if (this.Length > 0) // Check if the password length is honoured. { isLength = Regex.Split(password, @"\S").Length - 1 < this.Length; isValid = isValid * (isLength ? 0 : 1); } if (this.LowerCase > 0) // Check if the minimum number of lowercase characters is honoured. { isLowerCase = Regex.Split(password, @"[a-z]").Length - 1 < this.LowerCase; isValid = isValid * (isLowerCase ? 0 : 1); } /* * Special characters are: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ */ if (this.Special > 0) // Check if the minimum number of special characters is honoured. { isSpecial = Regex.Split(password, @"[[:punct:]]").Length < this.Special; isValid = isValid * (isSpecial ? 0 : 1); } if (this.UpperCase > 0) // Check if the minimum number of uppercase characters is honoured. { isUpperCase = Regex.Split(password, @"[A-Z]").Length < this.UpperCase; isValid = isValid * (isUpperCase ? 0 : 1); } return new Errors(isValid > 0, hasConsecutive, hasSpace, isInts, isLength, isLowerCase, isSpecial, isUpperCase); } } } UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 12, 2014 Share Posted February 12, 2014 But what if I wanted to see if "exit" was a valid password? Link to comment Share on other sites More sharing options...
guinness Posted February 12, 2014 Author Share Posted February 12, 2014 But what if I wanted to see if "exit" was a valid password? haha, unlucky! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now