Click here to Skip to main content
15,921,203 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: need help using a table control Pin
Christian Graus15-Aug-05 13:25
protectorChristian Graus15-Aug-05 13:25 
GeneralRe: need help using a table control Pin
ggsevenseven16-Aug-05 8:17
ggsevenseven16-Aug-05 8:17 
GeneralRe: need help using a table control Pin
Christian Graus16-Aug-05 13:30
protectorChristian Graus16-Aug-05 13:30 
GeneralPassword Generator Pin
PixelPixie15-Aug-05 4:05
PixelPixie15-Aug-05 4:05 
GeneralRe: Password Generator Pin
Rizwan Bashir15-Aug-05 4:09
Rizwan Bashir15-Aug-05 4:09 
GeneralRe: Password Generator Pin
PixelPixie15-Aug-05 5:51
PixelPixie15-Aug-05 5:51 
GeneralRe: Password Generator Pin
Daniel132415-Aug-05 7:11
Daniel132415-Aug-05 7:11 
GeneralRe: Password Generator Pin
PixelPixie16-Aug-05 1:43
PixelPixie16-Aug-05 1:43 
Thanks for that. I'll try it tonight after work.

I know what you mean about formatting it a bit Unsure | :~

Anyway. Can you try this for me, If you have time,

Public Function GeneratePassword(ByVal passwordLength As Integer) As String<br />
Dim Vowels() As Char = New Char() {"a", "e", "i", "o", "u"}<br />
Dim Consonants() As Char = New Char() {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v"}<br />
Dim DoubleConsonants() As Char = New Char() {"c", "d", "f", "g", "l", "m", "n", "p", "r", "s", "t"}<br />
<br />
Dim wroteConsonant As Boolean 'boolean<br />
Dim counter As Integer<br />
<br />
Dim rnd As New Random<br />
Dim passwordBuffer As New StringBuilder<br />
<br />
wroteConsonant = False<br />
For counter = 0 To passwordLength<br />
If passwordBuffer.Length > 0 And (wroteConsonant = False) And (rnd.Next(100) < 10) Then<br />
passwordBuffer.Append(DoubleConsonants(rnd.Next(Do ubleConsonants.Length)), 2)<br />
counter += 1<br />
wroteConsonant = True<br />
Else<br />
If (wroteConsonant = False) And (rnd.Next(100) < 90) Then<br />
passwordBuffer.Append(Consonants(rnd.Next(Consonan ts.Length)))<br />
wroteConsonant = True<br />
Else<br />
passwordBuffer.Append(Vowels(rnd.Next(Vowels.Lengt h)))<br />
wroteConsonant = False<br />
End If<br />
End If<br />
Next<br />
<br />
'size the buffer<br />
passwordBuffer.Length = passwordLength<br />
Return passwordBuffer.ToString<br />
End Function



Found it on the internet. Iv'e only just started programming, but I assumed that because it was a function. to get it to display, all I would need to do is

text_change event<br />
<br />
textbox1.text = GeneratePassword


But VB.net says tjhat it's not a string???? WTF | :WTF:

Any ideas?

P.s. I think I might go with your's. i'm just trying to understand how to display this.

Thanks


----------------------------------------------
You are you and I am I. So who is that?
GeneralVB.Net upgrade Pin
Member 75484615-Aug-05 2:24
Member 75484615-Aug-05 2:24 
GeneralRe: VB.Net upgrade Pin
wcnascar15-Aug-05 11:13
wcnascar15-Aug-05 11:13 
GeneralInput MessageBox Pin
| Muhammad Waqas Butt |15-Aug-05 0:32
professional| Muhammad Waqas Butt |15-Aug-05 0:32 
GeneralRe: Input MessageBox Pin
Rizwan Bashir15-Aug-05 2:04
Rizwan Bashir15-Aug-05 2:04 
GeneralRe: Input MessageBox Pin
Member 75484615-Aug-05 2:33
Member 75484615-Aug-05 2:33 
QuestionCombox ? Pin
| Muhammad Waqas Butt |15-Aug-05 0:28
professional| Muhammad Waqas Butt |15-Aug-05 0:28 
AnswerRe: Combox ? Pin
dptalt16-Aug-05 3:48
dptalt16-Aug-05 3:48 
QuestionHow to store changable data in VB 6.0? Pin
rushing15-Aug-05 0:23
rushing15-Aug-05 0:23 
QuestionOpen code-files as Collapsed? Is it possible? Pin
MaWeRic14-Aug-05 23:37
MaWeRic14-Aug-05 23:37 
GeneralHelp with safely removing USB flash drives Pin
Member 167164814-Aug-05 21:37
Member 167164814-Aug-05 21:37 
GeneralNeed help Pin
Anonymous14-Aug-05 20:24
Anonymous14-Aug-05 20:24 
GeneralRe: Need help Pin
DavidWayneJohnson15-Aug-05 0:57
DavidWayneJohnson15-Aug-05 0:57 
QuestionCan we add a ComboBox inside a Toolbarbutton or Toolbar? Pin
NewBieBie14-Aug-05 16:43
NewBieBie14-Aug-05 16:43 
GeneralAm I missing a reference or a com object or a import statement Pin
rolfjahn14-Aug-05 7:46
rolfjahn14-Aug-05 7:46 
GeneralRe: Am I missing a reference or a com object or a import statement Pin
rwestgraham14-Aug-05 8:45
rwestgraham14-Aug-05 8:45 
GeneralYou da Man!! Pin
rolfjahn14-Aug-05 9:26
rolfjahn14-Aug-05 9:26 
GeneralRe: You da Man!! Pin
rwestgraham14-Aug-05 9:34
rwestgraham14-Aug-05 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.