Getting Some Random Folder Name
Feb 11, 2009I'm trying to see if a folder exists[code]...
but if the user enters the number 5 for example, it gives me some random folder name. there is no folder named 5.
I'm trying to see if a folder exists[code]...
but if the user enters the number 5 for example, it gives me some random folder name. there is no folder named 5.
how to pick a random file out of a folder and open it, lets say we have text files. And i want to click a button and a random .txt file opens in my programs textbox.
View 11 Repliesi want to get a random directory from a specified directory, for example, the desktop.
im not sure how to do this, this and the only thing I'm having trouble with for my application
for example i have 5 different directories on the desktop called
Dir1
Dir2
Dir3, etc...
i would like to get Dir3, then maybe Dir1, after that maybe Dir3 again, and so on. i want to get a random directory from the desktop...dont really know how to explain it any better...
A specified a directory - a directory that i specify maybe in a text box for example. or a folder browser dialog
also i just want to get the path of the directory, i dont want to do anything to it.
I want to select a random image from my resource folder and show the image in a picture box.
View 9 RepliesWhat I want is when the program Loads, it would display random images from a folder on a website to a picturebox, like: [URL]thats a random pic but, [URL] is the folder of the image?
View 10 RepliesI have a picture box which reads in an image from a folder to display, instead of having the usual boring image I thought it may be nice to have a number of images in the folder and let my vb.net program randomly pick one out to use.
View 1 Repliesi want a random image from just a part of the resource folder to be shown in a picturebox . i have this code but it for the hole of the resource folder
Dim prng As New Random 'should be in namespace
'get list of all resources
Dim rs As System.Resources.ResourceSet = [code]......
With a button click event, how do I make a picture box image property switch to a random image from the resources folder?
View 1 RepliesI've read numerous posts and threads about random number generation, but I havent' run across this.If I generate a bunch of random numbers, the results are radically different if I create a new Random generator for each number than if I use on Random generator for all the numbers. The results are much more consistent and evenly distributed if I use the same Random generator.I would have thought the opposite,because creating a new Random generator each time should reduce the number of random repetitions, if a different time slice is used to create the random number.[code]......
View 9 RepliesThe class Random is out right defective. It always produces the same random numbers in the same sequence. Things I have tried so far is every kind of seed you can think of as well as Randomize. The result is that I always get the same random numbers in exactly the same sequence.
View 4 RepliesI am practicing using the drawing commands, and have gotten a grass background and black happy face that moves around the background.It's a 10x10 grid of 50 pixels.I want (at the moment, when i press enter) it to generate a random number of trees (15 ~ 25) at random locations on the background. The program doesn't freak out about anything, and the variables seem to be right (using stop commands) but it's not drawing anything. Here is the code for the "GenerateTrees" command I have for when I press enter.
Private Sub GenerateTrees()
NumberOfTrees = Int(Rnd() * 10) + 15
For i = 0 To NumberOfTrees - 1
bmap.MakeTransparent(Color.Fuchsia)
[code].....
I would like to use integers generated by Random.org in a small desktop widow app. Im using visual basic. All My search terms bring up unrelated (to My issue) information. Currently I am using the local random statement/command.
View 4 RepliesI am trying to make a texas hold em game and it is of the utmost importance that my code generate a random number. But using a random number function that I always end up with a lot of the same numbers over and over again. Any ideas on how to make it "TRULY" random? [code]
View 3 RepliesI've made an image viewer which opens a random image from a specified folder, but the random number is not that random at all... I've already used Randomize(), but without result.
View 3 RepliesI don't take programming lessons at school or anything, and I'm starting to (try to) teach myself about random things.Currently I'm making an app that has 3 functions:
-Random Integer (1 to 100)
-Random Answer (Yes or No, similar to a coin flip)
-Random Dice Roll (1 to 6)
How would I go about doing this?At the moment all I know about random numbers etc. is that I will need to do something along the lines of Dim dice As New Random or something like that, but, like I mentioned, I have no idea.I am well aware of the DIC rules that you won't write the code for me/do my "homework(?)" for me, and that's not what I'm asking.
VS2010 (SP1) / .NET 4 on Windows XP. The question is simple, the answer; not so much. When generating a salt, should the LENGTH of the salt be random, fixed or a random number within a (min/max) range? I am using RNGCryptoServiceProvider to generate the salt, just unsure of the length of the salt.
View 12 RepliesI am using Visual Studio 2008 Setup project. I need to copy one folder and the sub folders into the program files but when I tried to copy or add the folder to "Application Folder" in File System editor, I am able to add only files and not folders.
View 1 RepliesHow would I create a dir Inside %temp%? Then extract the file to it and Open a That folder. So far this is my code.
[Code]...
how to change the install folder path in a setup and deployment project/Installer class from program files to C:usersPublic in windows 7 and allusers folder in xp.Want to add MVP with my name.
View 3 RepliesI installed the new one. I then imported an old project made using vb 2008 EE.I found that a few errors were reported.In the project I addressed some function from a dll called "rsource.dll". I used the following function call:Public Declare Function rs_init Lib "rsource.dll" Alias "init" () As Double.The other different thing is the projevt was developed on a 32 bit OS but since then I have upgraded to 64bit (if this makes any difference). he other thing is where is the debugger PAUSE button. has it been removed from vb 2010?Also when i run debug it seems to create the exe in the Build output target folder instead of the default bindebug folder why is this?
View 5 RepliesPrivate Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
If TextBox11.Text = "" Then Exit Sub
MkDir(Dir1.Path + "" + TextBox11.Text)
MsgBox("Folder Created:")
TextBox11.Text = ""
End Subok now the file i have is from my.resources.test1 put this file into the folder that wascreated after mkdir line of code i have tried differnt ways of doing it but dose not work. it seams that this whould be so easy i dont if its me getting a mind block or something
Visual Basic 2008/2010 - Save Page As, create a Folder, upload the folder to a specific ftp site I am working on this vb app that will goto a specific site, click on a button(i am still working on the button process) do a save page as, create a folder, save those files to a folder and then upload that folder to a ftp site.
[Code]...
I have the following directory structure in my asp.net webdirectory i want when any body access anypage inside my admin folder then it auto redirect to login page of admin folder until they login
View 1 RepliesI have made this installation program and everything work just fine, but I wish to improve it a little. Atm. all the files being installed is in a seperate folder, and the installation program simply move them to the right location.There is a builder program too.I would like it to add all files from a list to the programs resource.folder instead of a seperate folder.Atm I add the installation file to the destination folder with the following line. [code]
View 2 RepliesCode so far:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
End If
End Sub
I have managed to get drag and drop working if this is any help:
Private Sub ListBox1_DragEnter(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
[code]....
How to add folder to the current users mymusic folder during setup deployment?
View 2 RepliesI have a question regarding publishing vis ClickOnce. For the publish options, there is a Publishing Folder Location and there is a Installation Folder URL. clarify the difference between Publish and Install, and when it would be apropriate for the two to be different?
View 3 RepliesI am wanting to get a complete file/folder listing and then copy these files to another folder.
Here is my
[Code]...
This happens on many folders. How can I get a listing of these folders and also copy these files?
I have the following code works fine in Windows 2000, after i moved to Windows Server 2003, it shows "Permission denied"...
View 1 RepliesSo I've been using some code to generate directories and such in a custom treeview, but am looking to expand upon this idea. While it's not using recursive functions, and only calls functions when expanding levels, I'm not quite sure how to put some of these together.find a way to just search through all folders on the PC. If the folder contains audio files, that folder is than added to an array (searching a folder for audio files and adding that folder to an array is done). It's just recursivly searching all folders on the PC.Here is the code I've been using for the treeview (I'm not sure if it can be adapted):
Public Function ListAllDrives() As String()
Dim arDrives() As String
arDrives = Directory.GetLogicalDrives()[code].....