Jump to content
xisto Community

tansqrx

Members
  • Content Count

    723
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by tansqrx

  1. Is there a way to request extra attachment space for posts on Xisto? I have used about half of the 500k in response to coding posts. A good example is http://forums.xisto.com/topic/96547-topic/?findpost=1064397808 where I created a Visual Basic.NET project to answer a question about listviews and also uploaded a screenshot to show what the finished project looks like. I understand the limit is low to prevent abuse but I am requesting a special exception for myself so I can continue to provide robust answers to questions that are best answered with a coding sample. P.S. I have -47 MyCents when I had a surplus yesterday. Is there a glitch in the system?
  2. It looks like the original poster was naughty and got himself banned. Anyway here is a solution for anyone else who needs it. Setup â˘Create new project called EditListviewExample in Visual basic 2008 â˘Add listview called lvMain â˘Add Item1, Item2, Item3, Item4, and Item5 as Items using the design view â˘Change View to list â˘Add a button named btnGet, numericupdown named nudGet, and a textbox named txtGet â˘Add a button named btnPut, numericupdown named nudPut, and a textbox named txtPut â˘Add Option Strict On and Option Explicit On to the code Option Strict OnOption Explicit OnPublic Class frmMain Private Sub btnGet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGet.Click 'This is to check and see if the index provided by nudGet is a valid index, otherwise 'and exception will be thrown. If CInt(nudGet.Value) < lvMain.Items.Count Then 'the values of a listview is held in the .items property txtGet.Text = lvMain.Items(CInt(nudGet.Value)).Text Else MessageBox.Show("Selection falls outside of the bounds of the listview") End If End Sub Private Sub btnPut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPut.Click 'This is to check and see if the index provided by nudPut is a valid index, otherwise 'and exception will be thrown. If CInt(nudPut.Value) < lvMain.Items.Count Then lvMain.Items(CInt(nudPut.Value)).Text = txtPut.Text Else MessageBox.Show("Selection falls outside of the bounds of the listview") End If End SubEnd Class The way to access any value within a listview is to access the item() property of the listview. This example will get the item value specified by the numericupdown or conversely put a value in the select item. You must realize that a listview is zero based like most other .NET controls and structures. If you get the value from the first slot you should ask for item(0). The listview is an incredible powerful control and you can do some very amazing things with it. You can also get the highlighted item by using selecteditems() or get the item under the mouse by using getimageat().
  3. Quatrux, yes you are missing a few features but nothing in the basic set. I use Pidgin also for one of my accounts and it serves me well. I like Pidgin because I am using it to communicate with my website and by that very nature I don’t know all of the weird things (exploits, viruses, etc) that will get thrown at me. I feel safer with Pidgin because it is not the official client and harder to exploit.On Yahoo! Pidgin does not support webcam, voice, or chat rooms which are some of the biggest features. You are also missing out on the IMviroment and some of the cheesier features. If Pidgin works I wouldn’t switch.
  4. An updated version of Yahoo! Messenger, version 9.0.0.2112 (http://forums.xisto.com/no_longer_exists/), was released on January 12, 2009. The latest release includes some bug fixes, changes to the message typing notification, easier SPAM reporting, and a new offline messages window. More information can be found at the Official Yahoo! messenger Blog (https://yahoomessenger.tumblr.com/).
  5. I never really expected much revenue from Kontera, but maybe in a year I will make it to the $50 mark. I am running Google’s Adsense on my regular site and I learned very quickly that ads don’t make any money.
  6. One possibility is to break open that shiny new external enclosure and remove the hard drive and then hook it up to an internal SATA or PATA port on your motherboard. This will rule out the possibility that the enclosure logic board is the culprit (which has happened to me before). You will also get a lot more information from the drive itself if your motherboard has SMART capabilities. Just look in the BIOS to see if it is reporting the hard drive as bad.If this still doesn’t work then I always recommend SpinRite (https://www.grc.com/spinrite.htm) for hard drive problems. It is pricy but it is one of the rare hard drive utilities that actually work.
  7. Some service providers are now giving their customers DHCP private addresses and not publically routable addresses. What this means is that some ISP customers are getting IPs that are behind a NAT router from the ISP side and they will never be able to host a server because they donât have a ture public IP. You should check the IP that your ISP is giving you and see if it is in the range of 10.x.x.x, 172.16.x.x â 172.31.x.x, or 192.168.x.x (https://en.wikipedia.org/wiki/Private_network). If so then you do not have a public address and your only resolve is to complain to your ISP. Any complaints are likely to fall on deaf ears and the only way to run a server is to purchase a more expensive business plan with a static IP.This is only one possible case and may not apply to you.
  8. I don’t know if I should be still beating this dead horse but I think this is a topic that still needs a little beating. Even though this thread and many like it have been on Xisto since the beginning, we still have new and young members that join all the time and they may be unwise in the ways of get rich quick Internet schemes. This type of service has been around from the very beginning of the Internet and I am sure you can trace it back to just after Adam and Eve in other mediums. Just be careful and don’t get your hopes up. I know you have all heard it a million times, if it is too good to be true then it mostly likely isn’t.The unique observation for this post is to point out some of the stats of ltc (http://forums.xisto.com/no_longer_exists/), the author of this thread. He joined on June 27, 2008 and has not been back since October 22, 1008. He also has only made 11 posts which are mostly in this thread. He is listed as hosted but I doubt that the webpage is still active because there are not enough posts to maintain hosting for more than a few days. All of this is just going to say that the original author mostly likely only created an Xisto account to advertise this pay per search scheme.
  9. I just got everything setup and I will see if it is worth it. How will the earnings be paid? I am assuming it will go directly to Xisto which will then go toward MyCents or myEarnings.
  10. Is the advertising retroactive to all of the threads that I have made or does in only start with new posts beginning in January of 2009? I have several threads that I started here on Xisto that get consistent hits from Google but they are from a few years back.
  11. One thing that hasn’t been mentioned is that Yahoo! is still turning a profit. From some of the posts it would seem that Yahoo! is in the red and will go out of business any day now but the reality is that Yahoo! has decent profits and dividends on their stock. The only reason that this is an issue is because Yahoo! is a publically traded company and investors want outrageous returns all of the time. If Yahoo! was still private this would never be an issues. With that said, I’m not sure how long Yahoo! will remain a separate entity. Investor pressures may move the Yahoo! board to sell the company.Personally I have made quite a hobby of following Yahoo! and in particular Yahoo! Messenger. I have thought for some time now that my hobby may be at an end because if Yahoo! gets sold then Messenger will surely be the loser in all of it. I have also noticed that Messenger is starting to lose market share. I feel that this is due to added restrictions on Yahoo! chat and the removal of user generated rooms. Chat and Messenger may seem like separate products but the only reason a lot of people had Messenger was because of the chat rooms which are now basically useless.
  12. I have heard this before. If you want a better Vista experience then you should try Windows Server 2008. I have a MSDN subscription so I may load it into a virtual machine and give it a try.
  13. Over the past few years I have come to realize that I function and learn best using a specific set of senses or what some would call learning types. The basic types are visual, auditory, and kinesthetic (http://forums.xisto.com/no_longer_exists/). A person can use a different style depending on the task. One example for me is reading. I hate to read; not the consuming information part because I love that but the physical act of reading. When given a book to read my eyes glaze over and I am usually instantly turned off to the idea. On the other hand I love to listen to audio books and I always have an audio book going in the car when I drive to work. Watching a movie about a book (one that is actually very similar to the book) is fine also but I would still prefer listening to the book rather than watching it. When it comes to consuming information in book form I am certainly an auditory learner. This leads me to how you interact with your computer’s graphical user interface or GUI. One of the most common tasks is to open a specific program to do work. But how does your mind process the task of finding the right icon? As some background I have my start menu in the classic view with custom folders sorted by such categories as CD, Graphics, Internet, Microsoft Office, System, and so on. All of the folders are sorted alphabetically. Some of the more common icons are on my desktop and the most common are in the Quick Launch bar in the task bar (desktop and Quick Launch icons are not duplicated). I will take for example opening Microsoft Word to do some writing. I always type my posts in Word because it has a built-in spell checker and I may want to do some formatting. In my mind I first see the Word form with no text in it. The phrase “Microsoft Word” never enters my mind but instead a location on the screen enters. In this case a shortcut to Word is in the Quick Launch so I see that in my mind. My eyes now start scanning the lower left screen and I pick the icon by color and not by any other attribute. In this case I know I am looking for a light blue color that corresponds to Word 2007. I then robotically click the icon and Word opens. From this I can deduce that when interacting with the GUI my mind is mostly focused on location and color. Anything else including the shape or wording under the icon makes no difference. If there are two identical icons such as a file folder shortcut I will then look at the text but only as a last resort. Two common situations back this up. The other night I installed a new program and despite the fact that I asked for an icon not to be placed on the desktop, it did so anyway. Vista is slightly different in that it inserts icons not at the end of existing icons but at the beginning under the recycle bin which results in all of the existing icons shifting down one space. When opening a particular text document on my desktop I always know it is in the first column on the very bottom. After installing a new program I instinctively clicked where I knew the document was and something completely different opened (both icons are white). It took me almost 30 seconds to figure out that happened and I deleted the rogue icon. The second situation happens in the Internet folder of the start menu. I have Firefox and Filezilla right next to each other and they both have a red icon. The physical location is roughly the same and the icon color is roughly the same. At least several times a week I open up the wrong program because of the confusion. My question is how to you find your icons on your GUI? Does your mind go for location and color like mine or do you look for shape, text under the icon, size, or perhaps something completely different?
  14. UAC gets really annoying when I sort my start menu. Even though I’m on Vista I still set the start menu to classic view because it is much faster for me to find things. I then sort each program into categories such as Internet, Graphics, CD, Programming, System, Microsoft Office, and so on. The folders are then always sorted by alphabetical order. This way the start menu is short and precise and I know where to look based on the type of program no matter what it.Let’s say I install a new icon editing program that gets installed into the Programs folder under Iconsoft > Iconsoft Icon Editor. Programs usually install their shortcuts not on an account basis but on a machine basis so moving them is a protected act. Here how it plays out.1. Move Iconsoft Icon Editor icon into the Graphics folder2. Confirm the move (UAC icon showing continue)3. Confirm UAC4. Delete Iconsoft because I don’t want the 10 other links that were installed5. Confirm the delete (UAC icon showing continue)6. Confirm UACNot too bad for just one program but I have the habit of doing this only once a month and by that time I have about 10 programs to rearrange. This is not a deal breaker by any means, just annoying.
  15. Here is my roughly 5 month update and I am still with Microsoft Vista and much happier now. It turns out that the majority of my problems were not with Vista but my firewall, Zone Alarm Free (http://www.zonealarm.com/software/free-firewall/). The downright odd behavior with not being able to create new connections, not being able to kill hung processes, and just general system instability was all Zone Alarm. After endless Google searches (and four months) for such things as âvista unable to kill processâ, âvista network stack failureâ, â and âvista network problemsâ I noticed that Zone Alarm was mentioned in more than one of the pages that I searched for. I finally followed a link back to the Zone Alarm forums and saw many posts that were describing problems not exactly like, but similar to my own. By this time I thought anything was worth a shot and uninstalled/restarted. When the system came back up, 95% of the problems were gone and I have been symptom free ever since. Due to the problems with not being able to kill a hung process such as Firefox or Internet Explorer I never thought that the firewall would be the problem. This goes to show you how deeply integrated a modern firewall program can be. In essence the firewall is part of the operating system and if it isnât functioning at 100% then you will see problems. Here is one of the articles that got me on the right track (http://www.techspot.com/).And there is a rundown of the original problems and the current outcome.IE STOPS RESPONDING ALL THE TIMEIn the original post I mentioned that this happened with no programs installed. I have come to realize that this was not completely true because I did have all of the basics such as antivirus and firewall loaded at the time. I will still occasionally have Internet Explorer or Firefox crash on me but this has mostly gone away with the removal of Zone Alarm. Issue closed.WHERE IS MY UP ARROW?I have learned to live without the up arrow for the most part but it is still annoying. I have come to like how each folder is displayed in the explorer bar and I can quickly jump up several levels. The problems stick around when there is a file dialogue displayed and you start in some very obscure part of the file structure and there is no side folder browser. This usually happens during installs where a program uses an older version of the file select API. Another problem can occur when the folder name is longer than the explorer bar width. In this case only one folder is shown and the benefit of jumping several folders at once is negated. With more Microsoft training I will eventually get used to it but I still often find myself saying, âwhere is that !@#$ up arrow.â Issue still open.UNABLE TO KILL PROCESSESAs described above this was all Zone Alarm. Even more at (http://forums.xisto.com/no_longer_exists/). Issue closed.CAN NOT CHANGE ATTRIBUTES FROM READ ONLYAfter the initial install this just went away. The problem was mostly on a secondary internal hard drive that I use for backup and some applications. I went through and removed the old XP owners from the file permissions and added the new Vista users. A more detailed explanation has already been posted by me in #8 of this thread. Issue closed.UACI am running UAC now but it can still be slightly annoying. It was off for several months but I turned it back on. I have learned that if I reorganize my start menu or some other task that requires hundreds of UAC acknowledgments then I will just turn it off and then back on. I also have a few regularly used programs that have to start under Administrator privileges so waiting for the extra 5 seconds it takes to display the UAC screen is the slightly annoying part. I still think it is a good idea but it should be faster. Issue still âslightlyâ open.SHUTDOWN PROGRAMSSame thing as before, Zone Alarm Free. (If you canât tell, Zone Alarm is not ranked so highly in my book now.) Issue closed.RAID RUNNING SLOWI didnât bring this up in the original article but after installing Vista the performance of my RAID controller handling my second hard drive went to you know where. When transferring data on my primary hard drive, which is SATA directly on the motherboard, I was having no problem getting 25-50 MB/sec. On the RAID card I was lucky to get 3 MB/sec. The performance was so bad that a USB 1.0 flash drive would outperform it. The card is a 3Ware 9650SE-4LPML SATA RAID 5 card with 256 MB onboard memory and a PCI Express connection. Under XP I never noticed a great difference of speed between the primary and secondary hard drives but under Vista the performance difference was scary. New drivers and a firmware flash did nothing. I eventually decided to reposition the card and remembered that I had it in a 1x PCIe slot. I moved it to one of the 16x slots (I have capability for dual video cards but only have one) and now the thing moves like itâs on rails. Iâm not sure why Vista likes the 16x PCIe slot so much more than the 1x slot but it works and I am glad to have this behind me also. Issue closed.CONCLUSIONSince that faithful day when I uninstalled Zone Alarm, the sky has turned blue (perhaps partly cloudy) the sun is shining, and the birds have been chirping in the background. My problems are now fairly run of the mill and I canât say that I am having any more problems than under XP. I am still impressed with the boot time compared to XP and that interface is still prettier. My biggest headache was getting all of my applications converted from XP to Vista. Some made the jump just fine but others had to be completely scrapped and a new solution found. After most of the third-party problems have been isolated I will have to recommend Vista to anyone who is looking for a new computer. Zone Alarm Free is now completely forbidden on any of my computers and I may upgrade some of my other computers to Vista in the coming months.
  16. I will try to be as open as possible here but I have to admit that I am a Windows person.For me the hallmark of a good operating system is productivity. The operating system where I can get the most done in the least amount of time is the winner. Since I grew up on Windows I inherently know more about the OS than any *NIX variants and for me I can get around the GUI much faster than in Linux. Another benefit of Windows is that it is usually ready for work once the installation has finished. I will spare the horror stories but several years ago I got through with an installation of Red Hat and the video driver was not installed. Of course no driver was provided and then the fun began with opening more configurations files than I care to remember.More deeply I also like Windows because I am a programmer and programming on a Microsoft platform is a MUCH more pleasant experience, at least for me. For all of the bad things that Microsoft is, I have to say that they take care of their programmer community. The best example is MSDN (https://msdn.microsoft.com/en-us/default.aspx) where you can easily find that any version of Windows is the most documented product ever. The documentation and examples easily outweigh the number of lines of code in Windows by at least a factor of 10. And of course because I like things to be fast and simple, I use .NET and my development time is cut many times.With that said there are some things that I would like to see changed. When installing Vista I could no longer use my ATI All-In-Wonder Radon because of the new DRM mechanisms. I am not very happy that there are now certain areas that are off limits to me even though I own the computer. There are also issues with some of the programming APIs in that you have to program the way Microsoft wants or nothing at all.I will think of more later on…
  17. Yes, use the Report option early and often. Any time I see an unsolicited advertisement I will report it and it usually gets removed within a few days. It is fine to tell the community if you have found a useful tool or even if you yourself have made a tool and would like to get the word out. I have to draw the line at blaitent advertisement. The usual offenders are virtual game currency traders (WoW gold) and the like.I do have to hand it to the moderators of Xisto for keeping most of the SPAM off of the board. From running a forum myself I know that it can sometimes be a full time job, especially if you become a target of automatic SPAMing software. Maybe one of these days I will have enough power to remove the SPAM for you
  18. Ahhh yes the IRQL_NOT_LESS_OR_EQUAL. I have seen this several time in my computer experience. The realistic answer is that IRQL_NOT_LESS_OR_EQUAL or BAD_POOL_HEADER could mean absolutely anything and unlike POST codes, Microsoft is not very descriptive with their BSOD or kernel panic codes. Basically about 1,000 different and distinctively separate conditions can cause either code. You may be able to Google and find some specific information but I have found this to be mostly a black hole.My personal experience has taught me that this is usually a hardware or low level device driver problem. The first place I would start is with the RAM and Microsoft offers a free tool called Windows Memory Diagnostic (http://forums.xisto.com/no_longer_exists/). If this turns up nothing you may want to see if the system is overheating by removing the cover from the case. The third thing I would do is reinstall Windows. Unfortunately this is a very hard problem to diagnose and you may have to try several things before you get any relief at all.
  19. Yes. The Vista version of Messenger had a lot of Vista specific features such as Windows Presentation Foundation (WPF) that made it look good. From what I can tell the Vista version just had a shiny GUI with the engine of 9.x. The upgrade should do nothing but fix certain problems while using version 9.x under Vista. Personally I have been using 9.x under Vista for several months now and I have seen no problems at all.
  20. Turbopoweredmaxsteel has a fine alternative method. I didn’t even think about adding everything to a list and then decrementing the random variable. I actually think this would be the most efficient (fastest) way to go for most applications. One small area where my approach may be more efficient is if you have some extremely long questions and there is a high penalty for I/O or the question list is more like 1 million questions and not 100. In this case loading all of the questions would be compute expensive and take up a lot of memory.
  21. Jerry Yang the current CEO and one of the original founders will be leaving the CEO post soon and returning to the position of “Chief Yahoo” (https://tech.slashdot.org/story/08/11/18/0151242/yahoo-ceo-jerry-yang-to-step-down). Many are speculating that pressure from the Microsoft take-over offer a few months ago has led Yang to step down from his current position. Several stock holds expressed anger when the Microsoft proposal was not accepted. The search for a new CEO should take several months and there might even be an announcement sometime in January (http://forums.xisto.com/no_longer_exists/) (http://forums.xisto.com/no_longer_exists/).
  22. You should be careful with going back to version 8 because Yahoo! recently announced that some of the features were being discontinued (http://forums.xisto.com/no_longer_exists/). Additionally many of the profile changes (http://forums.xisto.com/no_longer_exists/) apply to all versions and you may not be able to use a different picture now even in version 8.
  23. Yahoo! has released an updated version of Messenger and is now at version 9.0.0.234 (https://yahoomessenger.tumblr.com/). This is apparently due to some problems with the previous version working under Microsoft Vista after the official Vista version was discontinued.
  24. It looks like Iâm just a sucker for bleeding heart cases. I just took a smoke break and I came up with a better solution than the previous one. The best way to do this is to create an array and allocate all of the questions before hand. The array will be filled with numbers that are mutually exclusive. Since I am such a sucker I also figured out the way to best display the questions. I added a FlowLayoutPanel and then add a label control programmatically for each of the answers. Once again this may not be the best or most efficient solution but it gets the job done along with a nice user interface. I have attached the VB.NET project along with the reply if you would like to see how it works. Option Strict OnOption Explicit OnPublic Class frmMain Private _iQuestionCount As Integer Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click _iQuestionCount = CInt(nudQuestionCount.Value) Dim iIndex As Integer Dim iRandomValue As Integer Dim bValidQuestion As Boolean = False Dim aQuestions(_iQuestionCount - 1) As Integer 'set all the elements to -1 because the default 0 was tripping up the serach function. For iIndex = 0 To _iQuestionCount - 1 aQuestions(iIndex) = -1 Next For iIndex = 0 To _iQuestionCount - 1 While bValidQuestion = False iRandomValue = randomNumber(0, 8) If SearchArray(aQuestions, iRandomValue) = True Then bValidQuestion = False Else bValidQuestion = True aQuestions(iIndex) = iRandomValue End If End While bValidQuestion = False Next 'populate the questions to the form 'clear the form if needed flpMain.Controls.Clear() For iIndex = 0 To aQuestions.Length - 1 Dim lQuestion As New Label lQuestion.Size = New System.Drawing.Size(485, 13) lQuestion.Text = "(" + CStr(aQuestions(iIndex)) + ") " + randomPWQuestion(aQuestions(iIndex)) flpMain.Controls.Add(lQuestion) Next End Sub Private Function SearchArray(ByVal aArray As Array, ByVal iValue As Integer) As Boolean Dim iArrayValue As Integer For Each iArrayValue In aArray If iArrayValue = iValue Then Return True End If Next Return False End Function Private Function generateRandom(ByVal iLowerBound As Integer, ByVal iUpperBound As Integer) As Integer Randomize() Dim r As New Random Return r.Next(iLowerBound, iUpperBound) End Function Public Function randomNumber(ByVal iLower As Integer, ByVal iUpper As Integer) As Integer Return generateRandom(iLower, iUpper) End Function Private Function randomPWQuestion(ByVal iRandom As Integer) As String Select Case iRandom Case 0 Return "Where did you meet your spouse?" Case 1 Return "What was the name of your first school?" Case 2 Return "Who was your childhood hero?" Case 3 Return "What is your favorite pastime?" Case 4 Return "What is your favorite sports team?" Case 5 Return "What is your father's middle name?" Case 6 Return "What was your high school mascot?" Case 7 Return "What make was your first car or bike?" Case 8 Return "What is your pet's name?" End Select Return "Where did you meet your spouse?" End FunctionEnd Class
  25. This actually might be a tad harder than what Darasen suggests. The biggest problem is selecting mutual exclusive questions, i.e. not selecting the same question twice. Even though this is a homework question I will still provide some code. The bottom line is that blindly copying someone elseâs work without understanding it is stupid and you will do poorly in your class. On the other hand I donât think stupid should be illegal so here it is. This project is created in Visual Studio Express 2008 and is part of a program that I offer called YCC Yahoo! Bot Maker (http://forums.xisto.com/no_longer_exists/). YCC Yahoo! Bot Maker is simply a front end for making Yahoo! IDs and it requires input from the user to select such things as birthday and a security question. One of the options in Bot Maker is the ability to fill in random user data similar to picking 10 questions out of 100. This example will focus on the security question. The original program only has to pick one question so as a demonstration I will also pick a second question and show the results. The project goes onto a form called frmMain with two TextBoxes (txtQuestion1, txtQuestion2) and a Button named btnGenerate. The main function is the event handler for the Generate button. There are two random functions but one is just a call to the other more general function and the last function is what holds the questions in the form of a Case statement. The first question is straight forward and you just enter a random question for the security question list. The second question is more complicated because you canât have the same question twice. As I generate the first question I enter it into a Collection and hold it for future reference. The second question is in a While loop and will compare the random question with what is already in the collection to see if it already exists. If it is unique then the While loop variable is set to True and the loop breaks. Since there are very few security questions, you will encounter a duplicate question very often. As you can see this is not exactly the same that you requested but it should get you going in the proper direction. My solution is not very elegant but it gets the job done. When adding addition questions I would suggest adding a global variable that sets the number of questions to ask. From this you may be able to do some sort of For loop to iterate through all of the questions. The Collection is already setup for addition questions and thatâs why I choose it over a Boolean or string. If you are studying arrays then you may want to opt for that instead of a Collection but I prefer the Collection because it already has many features built-in. Option Strict OnOption Explicit OnPublic Class frmMain Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click Dim cExistingQuestions As New Collection Dim bValidQuestion As Boolean = False txtQuestion1.Text = randomPWQuestion(randomNumber(0, 8)) cExistingQuestions.Add(txtQuestion1.Text, txtQuestion1.Text) While bValidQuestion = False Dim strQuestion2 As String = randomPWQuestion(randomNumber(0, 8)) If cExistingQuestions.Contains(strQuestion2) Then bValidQuestion = False Else bValidQuestion = True txtQuestion2.Text = strQuestion2 End If End While End Sub Private Function generateRandom(ByVal iLowerBound As Integer, ByVal iUpperBound As Integer) As Integer Randomize() Dim r As New Random Return r.Next(iLowerBound, iUpperBound) End Function Public Function randomNumber(ByVal iLower As Integer, ByVal iUpper As Integer) As Integer Return generateRandom(iLower, iUpper) End Function Private Function randomPWQuestion(ByVal iRandom As Integer) As String Select Case iRandom Case 0 Return "Where did you meet your spouse?" Case 1 Return "What was the name of your first school?" Case 2 Return "Who was your childhood hero?" Case 3 Return "What is your favorite pastime?" Case 4 Return "What is your favorite sports team?" Case 5 Return "What is your father's middle name?" Case 6 Return "What was your high school mascot?" Case 7 Return "What make was your first car or bike?" Case 8 Return "What is your pet's name?" End Select Return "Where did you meet your spouse?" End FunctionEnd Class
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.