Fire The Timer Or Other Routine While Still The WHILE TRUE Routine Checks For Incoming Connections And Messages?

Jan 24, 2012

I am using sockets to send message between computers. I send the messages alright. What I want is when the message "x0x" comes, the client must be closed within 5 minutes. Teh admin can cancel the request by sending message "-xx" as well. The routine that checks for incoming connections and accepts messages uses WHILE TRUE...END WHILE since it must always listen. Once I get a message, I need to fire a timer control or other that fires within 5 minutes. But the program cant leave the WHILE TRUE at all. If i exit it early, the timer fires and the program does get exit. How do I fire the timer or other routine while still the WHILE TRUE routine checks for incomin connections and messages?

View 5 Replies


ADVERTISEMENT

Have To Hit Tab Key Twice To Fire Routine In Dgv

Jun 22, 2010

When entering a value in dgv I want the Tab key to fire a routine. Works out ok only thing is I have to hit the Tab twice before it fires. Don't know why, is there a way to prevent it, so that I have to hit the Tab key only once ?

View 1 Replies

Reference A Particular Code Routine In .net External To The Current Loop/routine?

Apr 17, 2011

is there any way to reference a particular code routine in VB.net external to the current loop/routine?Example:

If Var01 < 5
[Routine A]
Else
[Routine B]
End If

where Routine A and Routine B are code sequences at the end of the entire program -- such as outside of the current sub or class? The idea would be to reference an otherwise repetitive code.

View 4 Replies

Using A Central Startup Routine To Initiate Several TCP Connections?

Jan 6, 2011

I'm using a central startup routine to initiate several TCP connections, start up a background thread that does some monitoring, and instantiate a group of objects that track information throughout the lifetime of a networking session.

There are periodically server-side problems with the protocol I'm working with, at which point the whole mess has to be torn down and set back up, so at the front end of the startup routine I'm disposing of instantiated tracking objects, killing the monitoring thread, and disconnect/close the existing sockets (if they're already set up). At that point the sockets may be in the middle of an asynchronous send or receive operation, which is causing system exceptions when the socket is torn down and then the asynchronous delegate gets called and EndSend or EndReceive thinks there isn't an object there anymore.

I had assumed .Disconnect and .Close would take care of these async processes, and I'm a little lost. Is there some one-shot method I can use to abort those async operations before I tear the sockets down to re-instantiate them?It never hurts to try. In a worst case scenario, you'll learn from it.

View 10 Replies

Asp.net - Share A Variable From Sub Routine To Sub Routine?

Mar 3, 2009

I have a sub routine where I pull in information from a database. I want to use variables from this sub routine in another sub routine. I tried making everything public but it doesn't want to be friendly and share.

Dim strEmail as String
Public Sub readDB()
strEmail = "whatever@doohikcy.com"

[Code]....

The readDB would read the database and set the variables and do whatever it needs to do. Then when they submit the form it would e-mail the form to whatever the email address was.

View 2 Replies

Timer In A Thread - Routine Which Is Controlled By A Timer

Aug 13, 2010

I have a routine which is controlled by a timer. It works perfectly. The problem is that now, I need to run this routine several times, so I need to start differents threads so that my program doesn't get hung up. I've been trying to start my timer inside a thread, but it doesn't work!

View 18 Replies

Exit Timer Routine With A CTRL Key?

Jul 28, 2010

I've searched all over for what I think should be a simple answer.Is there a way to exit a timer (created to auto-click a mouse) with a CTRL key? I've tried everything and cannot exit withouth creating a button to stop the timer...

View 1 Replies

VS 2008 Incoming Connections?

Jan 3, 2010

I was wondering, if there is a way to block incoming connections from specific ip adress that tries to connect to computer

I assume that it cant be via windows host files

View 5 Replies

Block Connections To An IP Address (Incoming And Outgoing) In Visual C+ , C# , C?

Oct 29, 2009

Is there a way I could block connections to an IP address (Incoming and Outgoing) in Visual C+/C#/C???

I have a different method, using the windows hosts file. I could make it redirect, but on the host file, could I make it launch a certain application when it blocks an IP. Like, launch a file called blocked.html that says "Webpage blocked" on it? [code]...

View 3 Replies

Add Progress Bar To This Routine?

Jul 30, 2009

What would be the best way to add a progress bar to this routine so that it corresponds with the progress bar?[code...]

View 6 Replies

Sub Routine Not Executing?

Feb 4, 2011

I have the following code:

Code:
Imports System.Data.SqlClient
Imports System.Data
Public Class Main[code]...

and the sub Exceptionquery is not working. I can verify this because it is supposed to create a new table called scratchpad3. what I may be missing in that sub routine that isn't allowing it to work?

View 8 Replies

Using The SendKeys Routine?

May 28, 2009

I was looking for something send keystrokes and I found this helpful routine SendKeys that I can use in a VB Script. I wanted to have "Right Control Key + (Scroll Lock & Scroll Lock)" sent to the machine. Essentially, having the Right Control Key pressed, I need Scroll Lock pressed twice. Here is what I tried:

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys"^({SCROLLLOCK}{SCROLLLOCK})"

View 3 Replies

Why Is Sub Routine Not Firing

Feb 4, 2011

I have the following code:

Private Sub Exceptionquery()
Dim connection As System.Data.SqlClient.SqlConnection
Dim connectionString As String = "Initial Catalog=mdr;Data Source=xxxxx;uid=xxxxx;password=xxxxx"

[code]....

I get the error Invalid Object name 'Scratchpad3' on this line:

adapter.Fill(ds)

I have tried to debug this and can see that the query is correct, that the values that are being passed to the sql server are correct but it doesnt look like my code is firing off the Exceptionquery Sub. I thought to call a sub all you had to enter was the name of the sub such as this line:

Exceptionquery()

I have also verified that the mapping of the buttonclick event is mapped correctly. I have other subs that I am calling in almost the same way and those work.

View 1 Replies

C# - CSV Parser In One Routine/function?

Mar 9, 2010

I know there are several libraries of code out there that can parse CSV files according to the standard, but, for various reasons, I need one simple routine (not an entire library) that parses a CSV into a DataTable or array. Does such an animal exist or is it extinct? (Preferably C# but i can translate vb.net too)

View 3 Replies

Check Winner Sub Routine?

Jun 21, 2010

I am writing a noughts and crosses game and everything works but the checkwinner sub routine, so basically if someone gets three X's or O's in a row then a message box pops up saying either X has won or O has won.Below is what I have written in the sub routine.

[Code]...

View 2 Replies

Get Routine To Resume The Downloads?

Jun 7, 2012

I'm trying to get this routine to resume the downloads.I use the same routine to download a file all the way thru non-stop..so at least the download part is working..however either the stop commands i'm using or the resume routine i thought would work is all ass backwards I'm not gonna make any conclusions or anything on this one..made myself look stupid the last time i know you all are def smarter than me when it comes to this stuff,,and dangit that just erks me to no end i tried adding a exit do in the do loop..and that of course exits ok,,but when the file is resumed is larger than its supposed to be.

[Code]...

View 4 Replies

One Routine For Loading Collections

Sep 2, 2009

I would like to have 1 routine to load data into different collections.I would like to use the below routine in a more dynamic fashion...be able to load a different collections with different data dependent on strSQL.Is there a way I can pass the collection I want to use.If so, in the below code how would I differentiate to load the correct data to the correct collection? [code]

View 22 Replies

Speeding Up A Matching Routine?

Jan 21, 2011

I hoped you could give me som tips about speeding up som code i have to match an item to a collection of items... I have 1250 items that need to find the best match from 16774 items(every item is a class that consist of a string variable containing the path to an image, and 9 fields containg the most dominant color from a collection of 13 colors(the closest color)) The program does not use the filename or do any color matching in this step, only check the 9 fields... but it takes so

[Code]...

View 1 Replies

Sub Routine Within A Shared Subroutine?

Apr 9, 2010

How do I refer to a sub routine from within a shared subroutine? When I try the following code I get this error:Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.

Namespace CmdLineArgs
Friend Class Program
Shared Sub Main(ByVal args As String())[code]....

View 3 Replies

Write A Routine Using An Array?

Dec 31, 2009

I need to write a routine that enters real (scientific) numbers into an array of 20 spaces then adds all the numbers together and prints out the contents of the array plus the total value in a format such as: 1.0 + 2.0 + 3.0 + ...... + 20.0 = 210.0 in Visual Basic 2008.[code]...

View 16 Replies

Writing A Routine Using Dates?

Jan 2, 2010

I need to write a routine that compares the difference between any date in the past and the system date, showing how many days have elapsed since that date.

View 6 Replies

Receive Incoming SMS Messages Via Gsm Modem In Program?

Jul 21, 2009

I am working on an assignment whereby i am requested to receive incoming messages via a gsm modem, i have tried to do so by writing at commands to the serial port where the gsm modem is connected to but there's one specific line which gives me error when i tried writing it to the serial port, (AT+CMGL= "ALL") which returns me an error: CMS ERROR: 305 which means Invalid Text mode parameter The following is the codes i have done up to so far, can anyone tell me what is the correct way to write this specific line to the serial port or is there any other methods that is able to do the same thing?[code]...

View 8 Replies

Calling A Sub Routine On A User Control?

May 30, 2009

I have a panel2 inside a split container that has several user controls loaded into it. Panel 1 has an exit button and I want to call one of the sub routines that is in one of the user controls loaded into Panel2.

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Dim dialogMessage As DialogResult
Dim a As New ucTimeTracker[code]......

This line is giving me trouble "ucTimeTracker.autoWriteFileOnExit()"

I am getting (reference to non-shared member requires an object reference).Basically I want the exit button on frmMain. SplitContainer. Panel1 to call autoWriteFileOnExit() on the user control named ucTimeTracker that is loaded into splitContainer.Panel2

View 2 Replies

.net - Convert VB To C#: Email Sending Routine

Dec 30, 2009

I have a VB sub routine for sending emails.

I am not sure how to convert to C#,

here is the sub:

Sub SendAdditionalEmails()
Dim strDelimeter As String = ","
Dim strEmailResult As String = ""

[Code]....

View 4 Replies

Asp.net - Running A Code Behind Routine From An <a Href?

Sep 25, 2011

I have a link that looks like a button from this html <p class="link-styleContact"><a href="#"><span>Email Contact Form</span></a></p> can I run a code behind file when this is clicked on by adding the routine name to the href? like below

<p class="link-styleContact"><a href="ContactFormClicked" runat="server"><span>Email Contact Form</span></a></p>

View 3 Replies

Design A Routine That Will Allow The User To Search?

Dec 12, 2011

I am new to vb.net and am trying to design a routine that will allow the user to search for a record and return the results in a datagrid. Then double click on a row within the datagrid to view a more detailed form. I have been able to build the search form but am having problems with the double click event.I found a sample application on the Microsoft web site which is doing this on a smaller scale. The sample is built on the Northwind sql database and searches the customer table when you double click a row in the datagrid the following Microsoft code runs and opens a detailed form.

[Code]...

View 8 Replies

Determine Which Of The Two Events Triggered The Sub-routine

Mar 23, 2012

I have a combobox sub-routine that is triggered by either a "SelectedIndexChanged" or "Leave" event How can I determine which of the two events triggered the sub-routine

[Code]...

View 7 Replies

Findng End Of File In OleDbDataReader Routine

Jun 18, 2010

I am using the OleDbDataReader routine to examine and manipulate Access databases.I am trying to find a procedure for indicating when the end of file is reached.I am getting an error message once the end of file is reached and another record is attempted to be read.The.HasRows modifier does not work; that merely determines if the source database contains rows, not if there are any rows remaining.

View 2 Replies

Memory Leak In Simple Routine?

Nov 11, 2009

I have a service that i believe has a memory leak in one particular sub routine but I cannot find out why.The routine writes data to an opc server every second. It receives a command via tcp, connects to the database for verification of signals and writes the data. When it completes it writes a message back. I am disposing of everything i can think of but for some reason when I check it in the morning then memory has increased dramatically and the cpu usage goes up to 50%. this only happens to the service when I start the client application that sends the data so i know it has to be in this routine.

[Code]...

View 9 Replies

Pass An Array Literal To A Sub Routine?

Apr 2, 2009

Isn't there a way in VB to pass an array literal? Say the subroutine ask for an array of integers and you have just one. Can't you do something like

DoSomething({MyNum})
instead of
Dim MyNums as Integer() = {MyNum}
DoSomeThing(MyNums)

I'm thinking I'm just missing some adornment to the array literal inorder pass it.

View 4 Replies







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