|
The way this is usually done, is to create a second service, which watches for the first one and restarts it if needed. Of course, this involves you writing the code and I get the impression, despite this being a programming forum, that you're asking an admin question.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thank you so much for the concern. I already know about the "coupled-services" trick, and I can write it very easily. I just wanted to know if there was anything special about the way McShield.exe and Rtvscan.exe behave, if someone knew it after all. Orelse, have my service run within the main SVCHOST instance.
Yet, it is not an admin question as much as it is a problem that I want to solve with my VB.Net code. I saw something I liked in an app [or service, for the sake of accuracy ] and I wanted my service to have it. That's all!
BR,
Khallaf
|
|
|
|
|
OK, fair enough. I am pretty sure the coupled services trick is the only way to do that.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello,
I have used following code, it works for one time. As I want loop to work for 4 times. The code should dial number and show dialing status in Listbox. It do this for one time only. When It loop for second time, it do not show any dialing status in Listbox though dialing code executes(I saw thisin debug section).
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
Dim th1 As New Threading.Thread(AddressOf Dialsub)
th1.IsBackground = True
th1.Start()
End Sub
Private Sub Dialsub()
For i As Integer = 0 To 4
sw.Start()
System.Threading.Thread.Sleep(5000)
sw.Stop()
Dim tm As TimeSpan
tm = sw.Elapsed
'MsgBox(tm.Seconds)
If tm.Seconds = 4 Or tm.Seconds = 9 Then
' Dim rasconnection1 As New Ras.RasConnection
RasConnection1.PhoneNumber = "#777"
RasConnection1.UserName = "vwireless@ptcl.com"
RasConnection1.Password = "ptcl"
RasConnection1.Dial()
End If
Button9.Text = i
Next
End Sub
Private Sub RasConnection1_DialNotify1(ByVal sender As Object, ByVal e As Ras.RasDialNotify1EventArgs) Handles RasConnection1.DialNotify1
ListBox1.Items.Add(String.Format("{0}", e.ConnectionState, e.Message.ToString))
If e.[Error] > 0 Then
MessageBox.Show(String.Format("{0},{1}", e.[Error], e.Message))
End If
' RasConnection1.Dispose()
End Sub
Please me out to solve this.
|
|
|
|
|
Hi all
I'm working on something where a random num is generated between 0 and a user defined number. I need the random numbers to be in increments of 15 instead of 1
e.g. random numbers between 0 and 90 would only be
0 15 30 45 60 75 90
I figure I can do this by generating the random numbers between 1 and 7 for the above example and then substitute:
15 for 1
30 for 2 etc. etc.
But just though I'd ask here in case there's an easier way?
Appreciate a point in the right direction,
rgds
gerryR
Below is my rand function
Private Function genRand(ByVal intX As Integer) 'Function used to generate a random number between 0 and a given number
Dim intRandNo As Integer
intRandNo = Int(Rnd() * intX)
Return intRandNo
End Function
|
|
|
|
|
Hi, just generate a random integer within the appropriate bounds, then multiply by the increment you want.
|
|
|
|
|
Doh!
Spot on, thanks
|
|
|
|
|
you're welcome.
|
|
|
|
|
First i'd like to get the CELL the user enter info in and use that INFO to query my database to FILL the row the user entered info. in Datagridview. Thank you.
|
|
|
|
|
Depending when you need access to the grid data, you can access the information by e.rowIndex.
For example, in the event, Rowvalidating, I used the following line as part of my data validation:
If (PP_ScheduleDataGridView.Rows(e.RowIndex).Cells("Arrived").Value.ToString <> "") And (PP_ScheduleDataGridView.Rows(e.RowIndex).Cells("Departed").Value.ToString <> "") Then<br />
|
|
|
|
|
My form has one(1) datagridview and 7 textboxes and i need to save info. from the datagridview as well as textboxes into the database on the same form. Pls help
|
|
|
|
|
My form has one(1) datagridview and 7 textboxes and i need to save info. from the datagridview as well as textboxes into the database. Pls help
|
|
|
|
|
I did a search here on datagridview and got 10 PAGES of articles, with a little refining of the search I am sure you will find 1 or more articles to answer you myriad of questions.
It seems obvious that you have no idea about the DGV, try reading some of the articles before peppering the forum with questions.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Can anyone guide me, how to write the code for searching the deatils in alphabetical order like..........
A B C E F G.... Z..
All the alphabets will be in link format like
If u click on 'A' all the names in 'A' as to be displayed maybe using a list box then put all the buttons on the side of it, then the other side will be list view i have the listview working and also added a listbox i can pull the data thru it but i dont know how to tie buttons to it i am using sql server 2005 express hope someone can help me thank you
|
|
|
|
|
You would have logic like for example:
- when button is pressed, you get a connection using SQLConnection
- you create a SQLCommand where you fetch the data and you define the condition using SQLParameter
- then you open SQLDataReader
- you loop through the reader and add the data to the list
- close the connection
Also you should use connection pooling in order to have decent performance.
|
|
|
|
|
ok i am really suck , i got a text file with a list of picture paths eg . c:/test.jpg ect.
the following code below , allows me get the image location one at a time and then add it to imagelist1
my question is how do i add this to a large icons in listview ??
Dim oRead = IO.File.OpenText("C:\pics.txt")
While oRead.Peek <> -1
LineIn = oRead.ReadLine()
ImageList1.Images.Add(Image.FromFile _
(linein))
End While
oRead.Close()
i cant get from imagelist to listview . any help would be great
cheers
luke
|
|
|
|
|
|
Hi all,
I am working in a vb project, which use only .exe file in the end user session. I am having a problem in .OCX file which is .exe not working in Vista and Windows 2008.
I used regsvr32. which required administration authentication. How i can solve this issue.
Can any one help me to resolve this issue. I great full for them.
Thanks in Advance
with regards,
Senthil.S
A Software Engineer
|
|
|
|
|
An ocx cannot work without being registered. On Vista and 2008, this requires an admin. There's no way around it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi.. i have read before that we can receive file using bluetooth through obex file transfer.. but there is one question that i just cant find the answer.. how can we receive multiple file using bluetooth.. thanks in advance..
Audrey
|
|
|
|
|
I want to add a button in a form and add Click and DoubleClick events for the button,but the code below doesn't work,why?How should I do?
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim btn As New Button
Me.Controls.Add(btn)
btn.Text = "hello"
AddHandler btn.Click, AddressOf btn_Click
AddHandler btn.DoubleClick, AddressOf btn_doubleclick
End Sub
Private Sub btn_doubleclick(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox("Double click")
End Sub
Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click
MsgBox("Click")
End Sub
|
|
|
|
|
Abraham1 wrote: the code below doesn't work
is not informative. Does not compile? does throw an exception? which one? etc.
why are you handling Click and DoubleClick differently? (there is a "Handles MyButton1.Click" but there is no "Handles MyButton1.DoubleClick")
why do you have two buttons, one called "btn" and one called "MyButton1"???
|
|
|
|
|
The Button control doesn't use the DoubleClick event, so it's never going to get fired.
|
|
|
|
|
strike 2.
|
|
|
|
|
Eh, both are kinda right. There is a double click event, but it's disabled by default through the control styles.
MSDN: By default, the ControlStyles.StandardClick and ControlStyles.StandardDoubleClick style bits are set to false for the Button control, and the DoubleClick event is not raised.
For more information about handling events, see Consuming Events.
Change the control style or extend the button and the doubleclick method yourself.
Article that is referencing C#, but you can get the jist.
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=1481968&SiteID=1
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|