Databind CheckBoxList ASP.NET 2.0





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

9
Date Submitted Sat. Sep. 23rd, 2006 5:53 AM
Revision 1
Beginner vbdotnetboy
Tags "Random Generation" | .Net | VB.NET
Comments 1 comments
Description:
Call one of the overloaded functions and a you will have a randomly generated password.

Generate() - Will generate a password 13 or (more/less) characters in length ranging from A-Z a-z 0-9 and other characters such as @ # %... etc.

Generate(ByVal AsciiMin As Integer, ByVal AsciiMax As Integer)
Generate(ByVal AsciiMin As Char, ByVal AsciiMax As Char) - Allows you to set your ASCII range if you wish not to include number for example.

Generate(ByVal ExcludeValues As String()) - Works like Generate() buts characters passed in the array will not be used to generate the password.

Generate(ByVal AsciiMin As Integer, ByVal AsciiMax As Integer, ByVal ExcludeValues As String())
Generate(ByVal AsciiMin As Char, ByVal AsciiMax As Char, ByVal ExcludeValues As String()) - Works like Generate(ByVal AsciiMin As Integer, ByVal AsciiMax As Integer) & Generate(ByVal AsciiMin As Char, ByVal AsciiMax As Char), but allows you to also exclude characters that you do not wish the generator to use.



UPDATE
03/06/2006: Included use of Phill64's TrueRandom2 class for generating random numbers. Also overloaded the constructor so that a length can be set for the password, if the length is not set the default is set to 13.
8
Date Submitted Sat. Sep. 23rd, 2006 5:06 AM
Revision 1
Scripter Pio
Tags MD5 | Security | VB.NET
Comments 1 comments
This could be used for any type of simple hash checking. It could also be used to store a "password" that had to be verified. This code is completely managed.
8
Date Submitted Fri. Sep. 22nd, 2006 12:16 AM
Revision 1
Scripter sehrgut
Tags C | CGI
Comments 0 comments
The best way I've found to keep a suite of CGI environment variables in my C CGI programs is actually just to read them as name-value pairs into a stack. It simplifies parsing and makes the code cleaner and less fragile than using a specialized structure or an ordered array of strings (as well, empty variables are simply not push()ed onto the stack, so memory doesn't have to be allocated for empty strings). Plus, since there are never a huge number of environment variables, and they are all unique (by definition), a search through the stack for a given name takes minimal time. In fact, retrieval of environment variables beats a PHP-like hash-table implementation by a good deal.

In the code below, all you have to keep in mind is that the NVStk is a name/value pair stack (implemented as a singly-linked list with each node containing two char*s). Variable retrieval times can be minimized by adjusting the order of variable names in the char**s passed to sgcgi_getenv(). In fact, the ones below are just about backwards from how they ought to be, since I forgot I was using a stack instead of a queue . . . *blush*

Of course, there are more environment variables you can get, but you have to draw the line between exhaustion and efficiency, and that depends on the project. The variables included here are pretty much overkill for any program you're likely to need.

A nice way to use these types of functions is to wrap them in an accessor function that gets the environment once and keeps it as a static variable, and then on subsequent calls just looks up values in its stack. (If you want to see the NVStk, I can put it up, but it's pretty much a basic linked list.)
5
Date Submitted Thu. Sep. 21st, 2006 7:48 AM
Revision 1
Scripter Pio
Tags math | Percent | VB.NET
Comments 2 comments
Returns a percentage. There are 3 arguments.

1. complete - How much is done?
2. total - How much is there?
3. maxPercentage - Total percentage possible, usually 100.

Simple, yep.
4
Date Submitted Thu. Sep. 21st, 2006 7:30 AM
Revision 1
Scripter Pio
Tags ArrayList | System.IO | VB.NET
Comments 3 comments
Loading and Saving an ArrayList to/from any given path.
6
Date Submitted Thu. Sep. 21st, 2006 7:07 AM
Revision 1
Scripter Pio
Tags filesize | System.IO | VB.NET
Comments 1 comments
An all in one function that formats a given file's Size from bytes to gB.
7
Date Submitted Thu. Sep. 21st, 2006 6:47 AM
Revision 1
Scripter Pio
Tags System.Drawing.Color | VB.NET
Comments 3 comments
Have you ever tried to use Color.Blue.ToString and gotten undesired results?
Or have you ever tried to save a color to an INI and not be able to reproduce it the next time around?

The methods below will help you in your conquest of converting the Color structure to HTML (#FF0000) and back to a Color structure again.
5
Date Submitted Mon. Sep. 18th, 2006 6:59 PM
Revision 1
Helper jbplou
Tags VB.NET
Comments 0 comments
Counting for loop in VB.NET. Looks easy because it is, but I saw one submitted for PHP.
4
Date Submitted Sat. Sep. 9th, 2006 9:22 PM
Revision 1
Helper jbplou
Tags String | VB.NET
Comments 2 comments
This function provides the reverse of a string. It is constructed using string builder because strings in .NET are immutable, while stringbuilders are not. Therefore large strings could be slow to reverse if a regular string was used for the working value that is returned.
3
Date Submitted Sat. Sep. 9th, 2006 11:10 AM
Revision 1
Helper jbplou
Tags Exception | VB.NET
Comments 1 comments
This function returns a stack trace for an exception with all inner exceptions include unless the count of inner exceptions goes over 50. A stack overflow can occur if there is no upper limit for inner exceptions to read from.

Makes use of stringbuilder to build return string in order to yield higher performance.