Filewatcher Stopping At Random Times

Apr 9, 2010

I have created a form in which it watches a specified path for excel file changes - this part is on load.

[Code]...

This is supposed to delete any temp file that gets through. Then, when it finds an excel file, it will try to open it. I noticed the sub kept launching when I opened the excel file, so just another check to make it safe. the two variables filearray1 and filearraypath2 are public - filearray1 is an array list with full excel paths (another thread loops through the array and does the operations of the excel file) and filearraypath2 makes sure that the same excel file won't be added twice in a row.

Now, this works really well, but for some reason, at some point, the addfile sub won't kick off, even if excel files are changed, created, deleted, anything. I set a breakpoint on the first 'if' line of the addfile sub, opened an excel file and made changes, or created a new one, and let the program run for 10 minutes and the breakpoint never hit.

View 1 Replies


ADVERTISEMENT

VS 2010 Draw Rectangle (random Times, Random Location)?

Nov 26, 2011

I 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].....

View 4 Replies

Random Number Of 6 (1 ,6), And To Loop It 3 Times?

Feb 16, 2009

I need a random number of 6 (1 ,6), and to loop it 3 times. I tried this but it gives me error for - if myRandom.next(1,6) Then:

Dim myRandom As Random()
For i As Integer = 1, 3
If myRandom.next(1, 6) Then
End If
Next

Also I need to know the code for putting a picture into a picture box.

View 4 Replies

Random Number Generator Generates Same Numbers 19 Times Out Of 20 ?

Apr 1, 2010

I am trying to write a random number function that can just be called from my main module to generate different random numbers. I have tried this several different ways and I am having odd results. Approximately 19 times out of 20 the numbers come back exactly the same, but approximately 1 in 20 they come back as two different numbers. Im using Visual Basic Studio 2008. Here is the code I have so far, or rather, the current version of my many tests I have been running to try and figure it out. Sometimes it takes many runs of the program before the two seperate numbers apear.I've been researching it and have come up with nothing so far.I know I could put them in the module section as two different randoms and it works, but I get extra points if i use a couple classes in my program.This is the main module.

Module Module1
Sub Main()
Dim randomNumOne As New RandNum[code]...........

View 4 Replies

Random Number Generator Generating Same Number Many Times?

Sep 17, 2011

I have this program generating a firstname and lastname from a file. When I run this program I enter information in three textboxes. The first two are the salary low and high(salary1.text, salary2.text) and the last one is the number of "copies"(copies.text) that I want.. When I put a number such as 10 in the text box it outputs some of the same names. The firstname file has around 100 records and the lastname file has about 1000 records Why is it generating the same name The problem is even worse if I do something like 1000 copies.. it outputs the same thing 8 times and then does something different another 8 times

Public Class Form1
Dim sex As String
Function randomfirstname()
Dim infile As IO.StreamReader

[code]....

View 1 Replies

Enlarge An Image Up To 32 Times Or 64 Times Bigger Than Original?

Dec 12, 2011

I want to enlarge an image, possibly up to 32 times or 64 times bigger than original dimensions (so that the user can see each pixel) if possible. The following is a simple function that I have to enlarge an image.

Private Function xEnlarge(ByVal Source As Image, ByVal Rate As Double, Optional ByVal Quality As Drawing2D.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic) As Image

[Code].....

View 6 Replies

Forms :: Find If Times Is Between 2 Times?

May 13, 2009

I have just started using vb.net and I have a checked list box with times throughout the day shown as

00:00 - 00:14
00:15 - 00:29
00:30 - 00:44
00:45 - 00:59

What I am trying to find is a way to get the current time and find which list item it fits into. What I think I need to do is to first of all get the current time and then go through the list splitting each item into 2 times and seeing if the current time fits. For example: Split the item 00:00 - 00:14 to 00:00 and 00:14 and then check if the current time is more than 00:00:00 but less than 00:14:59 and if so do certain task.how to go about taking each list item and splitting it into 2 separate times so I can check between them?

View 2 Replies

Creating A New Random Generator Each Time Should Reduce The Number Of Random Repetitions?

May 26, 2011

I'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 Replies

Bug In VB 2010 RC - Class Random - Always Produces The Same Random Numbers In The Same Sequence

Apr 4, 2010

The 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 Replies

Assigning Integers Using Random.org Instead Of The Local Random Feature?

Oct 10, 2011

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 Replies

Code Generate A Random Number / How To Make It 'TRULY' Random

May 29, 2011

I 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 Replies

VS 2010 - Image Viewer - Random Number Is Not That Random At All

Apr 19, 2012

I'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 Replies

Stopping A Loop?

Nov 12, 2010

What i have to do is write a program to display multiplication table when a number is put into the textbox and it prints out multiples of 1-12

ex.
user puts in 5, listbox should say
5 x 1 = 5

[code].....

View 1 Replies

.net - Stopping Other Subs From Running While In A Sub?

May 22, 2010

Is there a way to stop other subs from running while in a separate sub.

for instance say your in the sub
CreateNumber()
and the subs are setup like
CreateNumber()
AddNumber()
DeleteNumber()

Is there a way to be in CreateNumber() and call a function to stop AddNumber from running after creaetNumber() is finished? i just want my program to sit there to wait for an event to happen.

View 1 Replies

Playing One .wav File Without Stopping The Other

Nov 29, 2007

I'm currently programming a music software which plays notes which are listed. as timer ticks, the notes change and so it plays a different *.wav file. The problem now is that the previous sounds stops when a new sound starts. i want them to overlap each other until each one has finished. Code: my.computer.audio.play("file.wav")

View 30 Replies

Self-Stopping Timer Won't Stop Itself?

Feb 6, 2012

I've been trying to create a timer that waits for another timer to finish with its coding and, when it's finished, executes a series of code before stopping itself.

This isn't the code for the actual program I wanted to implement this self-stopping timer in, but it's simple and has the exact same problem:

Public Class Form1
Private Synchro As New Timer()
Private Sub MeLoad() Handles Me.Load

[Code].....

The idea here is that it's suppose to (using a timer) show the messagebox ONCE and ONLY once per button click. However, what seems to happen (despite the fact that I have 4 ways of trying to tell it to stop) is that the program creates multiple messageboxes until there are a total of about 49 messageboxes on the screen at the same time. I don't know if I'm using the wrong event (unlikely as Tick seems to be the only timer event) or there's a way of stopping the timer that I don't know.

View 7 Replies

Services Stopping On Windows 7 After Log Off?

Aug 25, 2010

I created a service in VB.NET and it runs fine on Vista, I can log off and switch users and the service auto starts and continues to run every time without fail.If I install and run the service on Windows 7, it will not start after a logg off/on or after I switch users.

View 3 Replies

Starting And Stopping A WCF Service

Oct 8, 2009

I have a WCF service, which I can open and close by doing:[code]The problem with this is I have "downtime" of the service in between myService. Close() and newService.Open(). if anyone tries to connect while this is happening it fails. how can I make the "downtime" as small as possibel?

View 12 Replies

Stopping A Timer After Ten Flashes?

Oct 14, 2010

I'm trying to figure out the code for the timer that would allow me to stop the timer after X number of runs through the code. Here's what I have so far:

im tmr_cnt As Integer
tmr_cnt = tmr_cnt + 1
If CInt(boxAns.Text) = CInt(lblnum1.Text) / CInt(lblnum2.Text) Then

[Code].....

View 3 Replies

Stopping A User From Destroying DB?

Mar 4, 2011

I'm developing an interface for users that will allow them to enter data into a database without having to know SQL. Problem is, some one out there probably does.

How can I stop them from deleting/screwing with my data when they're typing entries within my text boxes?

For example, I don't want anyone to be able to type in DELETE * or any other kind of SQL statements in a text box to ruin the DBA's day.-Nothing to see. Move along.

View 3 Replies

Stopping Function On Event In .net?

May 18, 2010

I have a vb.net application which does some processing. This processing can take a while. The application doesn't respond until the processing has ended and then it handle all events (such as click on buttons) that the user has done during the processing. I'd like to add a "Stop" button so that the user can stop the processing at some point. How can I do that? Could threading the processing (which is done in a function of the application) be a possible solution?

I tried to add a button which change a boolean value and putting the code of the processing function inside a while statement based on that boolean value. However it doesn't work because the click event on the button is processed only after the end of the processing.

View 2 Replies

Stopping Processes When App Closes?

Aug 5, 2009

Ok, so the PDF problem was traced back to when I would close the test build. When I would close my app via Me.Close the Adobe.exe was still an active process.

I have several forms that include multiple PDFs. I need to ensure that the Adobe.exe process is terminated during the exiting of my applications.

How is this accomplished or is there another way?

View 2 Replies

Stopping The Loop Stuff?

Jul 23, 2011

I used a combination of If and doWhile loop codes. Is it possible that the loop will stop at 2nd loop if it will perform a 3 loops?I'm creating an app that if the problem is got the match at 2nd out of 3rd loop, the loop will stop.

View 1 Replies

Stopping The Rest Of The Code?

Jun 23, 2009

I have this code within a button: If TextBox1.TextLength = 3 Then MsgBox("Please enter 3 numbers followed by a letter. For Example 001A")TextBox1.Text = "" Me.Refresh() End If Although if the user enters 3 numbers only, I want the rest of the code in the button to be ignored so that it doesn't proceed.

[Code]...

View 3 Replies

VS 2008 Stopping A Service

Apr 26, 2012

I know the title of this thread is a show stopper for a lot of us . But what I want to do is stop two services from running for a period of time then restart them. I know I can do this from the command prompt by using net stop servicename then restart with net start servicename. I need these two services stopped to do some work on the database. I do this manually right now and want to automate the process. I tried process.start with the command net stop but that did not work out. If I try the Process List I get the process running but not the services.

[Code]...

View 4 Replies

VS 2008 Stopping For Loop?

Jun 19, 2012

I was wondering if there was any way to stop a for loop untill i have user input, once the input is correct continue the for loop, is that possible at all

View 3 Replies

VS 2010 Run App On Server Without Stopping?

Dec 15, 2011

I have an application that is on a server running. The way I have it setup is I put it on the Windows Scheduler to run at certain times. We now need to run it constantly on the server. I change the code to put in a loop until I pause or stop it. One issue I have found is that I can kick it off but when I close out of my remote session the application stops.

How do I keep my application to keep running even after I sign out of RDP?

View 6 Replies

VS 2010 Stopping A For Loop?

Feb 10, 2011

I was wondering how someone could stop a For loop in the middle of it, according to parameters. I have tried but cannot find a solution that works, I suppose an example of this would be if a loop were increasing a label by 1 from 0 to 100 and the user sets it to end at 57 or any number in between and when the loop reached the number to stop.

View 8 Replies

Blue Screen When Stopping Execution In IDE?

Jan 13, 2012

Using this code, before I added the funky "abort" button code - stopping it using the Stop Debugging button in the IDE blue screened my computer every time, PROCESS_HAS_LOCKED_PAGES - Anyone care to try it ? Win7 Ultimate , VS2010 SP1. This machine has never blue screened since it was built. Code is by no means exotic in any way.

Public Class Form1
Dim Abort As Boolean = False
Private BStart As New Button

[Code].....

View 8 Replies

Function Not Getting Called, And Program Stopping?

Apr 18, 2011

I have a function to pull data from a XML, and to report a specific number based on a value in one of the elements in the XML. Unfortuntately, I can't get any break points to work, so I've been debugging with a trace.he strange this is that when i take out the function itself it works like it should, otherwise the Service freezes when it gets to the function and never uses it. I'm calling the function in while loop which is also within a Try Statement, here's example of the code.

Public
Shared Function GetXNumber(ByVal
audit As Audit.API)

[code].....

View 12 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved