|
One way is to send your event count to the Event Log. Another way is to send the data to the MSMQ.
-- modified at 5:40 Friday 17th November, 2006
|
|
|
|
|
The best way to keep these kinds of counts would actually be to use performance counters. Keeping this information only internally using variables will work, but you then have to decide how you are going to access that data at runtime. As George's post points out you can use the event log or MSMQ.
Owen West wrote: I have looked into Custom Commands and could implement these but how do I get the service to return a value?
You won't really be able to do this using OnCustomCommand as this function does not return a value. One option that would work as long as you are always going to be running your ServiceController application on the same system as the service would be to implement OnCustomCommand and have it write the values to a file or registry key. Then your ServiceController app would simply read the file/registry key to get the values.
I do think using performance counters will be the best approach as it will give you the flexibility to add additional data points in the future and it gives you (and your end-users) insight into this type of information in an established UI view.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Hi,
I hope someone can help me with the following as I do not know how to proceed.
To allow users to create(from database data), edit(word documents that already exist on the server) and upload edited Word documents to a web server, I have written a WebApp and Standalone Client side Windows application that allow the following.
An example of the basic steps for the process is:
1. User opens browser
2. User starts local Windows application
3. User browses to an item and clicks an edit button
4. Data saved to temp database table to say using wanting to edit word document
5. The application running in 2 is continual polling the Web App to check
if client has requested an item for editing (ie: It checks if temp database has
been populated)
6. If a user has requested to edit the local application requests data from the web
server, downloads the data, builds and opens a Word document.
7. When the Word document is opened a ~$......doc file is also created in the same
directory
8. The local application is constantly listening to see when the ~$......doc dissappears,
when this happens it displays a pop-up asking if the user wishes to save the
document back up to the server
I need help though:
Question 1: How can I make my local application start automatically when the machine is started and to always remain running but not visible but still usable (ie: A request to download and build a document always happens even if the application is running in the background)
Question 2: Is there a way when closing Word for Word itself to pop-up a 'do you want to upload the document to the server' itself instead of as now my standalone application doing the work?
I hope someone can advise as I am somewhat uncertain of what can be achieved and/or where to look for the answers.
Thanks in advance
Andrew
|
|
|
|
|
Is there any way in a combobox to find the index of an item or set the item in a combobox by the value? I know there is a FindString, and a FindStringExact method in the combobox object, but is there anything simmilar or any work around to getting the index of an object or setting the selecteditem by the value? Any help is appreciated, thank you.
Jason
|
|
|
|
|
If I understand your request You want to find the index of a value in the combo box and also getting the selected item index ?
well,
for getting the index of a value in the combo box:
cmbBox.Items.IndexOf("Male");
will give you the index of the object with the value of "Male"..
and to get the selected item index you can use the property "SelectedIndex":
cmbBox.SelectedIndex
to get the index...(or to set it..)
and:
cmbBox.SelectedText for a string
or cmbBox.SelectedValue for an object
(get && set)
next time, make a little search on our good friend Google...
You could find it easly..
Good luck.
|
|
|
|
|
Without googl'ing it I already knew all of those properties you are telling me about (not to be arrogant, just to answer your reference to Google, I know better). You didn't understand the question, perhaps you haven't encountered this problem, if you have a combo box loaded with objects, say STATE objects, and the objects have 5-10 properties, and this is say on a customers form, when the user loads the info on a customer, you want to set the state the customer is from, and in your database, in the customers table you will only store the state id for the customer, and thus when you populate your customers form, you will only have the state id, unfortunately even if you create a state object with just the id set, when you do an indexof it won't match and give you nothing, and like I said, you have only the state id, which means no text, and if you do cmbBox.SelectedValue = myState.Id, it won't work even if you set the value member as ID... so what I'm after is something to this effect:
myComboBox.SelectedIndex = [some function that returns the index of the
object in combo box with ID = x]
OR
myComboBox.SelectedItem= [some function that returns the object in combo box
with ID = x]
OR
myComboBox.SelectedValue = myState.Id
Jason
|
|
|
|
|
So in the beginning I didn’t understand your exact problem...
Anyway,
At the moment the best way I think about to solve this problem is creating your own function that runs on the list of states and search for the specific id... so the function will return the index..
to make it easier You can even inherit from the class Combo Box and overload the function indexOf so it will do the job..
When I will have a better answer for this problem I will notify you
Good luck!
|
|
|
|
|
is anyone familiar with the rosettanet RNIF frame work for sending B2B files (Invoices etc) in .xml format.
and can this be done from a DotNet Application.
i can only find developers Using BizTalk server or a purchased solution from a vendor.
thanks for any help or advice.
rik
|
|
|
|
|
Dim oBitArray1 As System.Collections.BitArray
oBitArray1 = New System.Collections.BitArray(4)
oBitArray1(0) = False
oBitArray1(1) = True
oBitArray1(2) = True
oBitArray1(3) = False
Dim oBitArray2 As System.Collections.BitArray
oBitArray2 = New System.Collections.BitArray(4)
oBitArray2(0) = True
oBitArray2(1) = False
oBitArray2(2) = True
oBitArray2(3) = False
Dim oBitArrayOR As System.Collections.BitArray
oBitArrayOR = oBitArray1.Or(oBitArray2) 'This changes the content of oBitArray1. Bug? (.Net 2.0)
'----------------------------------------------------------------------------------------------------------------
'| Conversion from string "" to type 'Double' is not valid. Why? |
'----------------------------------------------------------------------------------------------------------------
'|Bug |
'|--- |
'|You cannot use a '+=' to concatenate a string with an integer because it wants sum the values and |
'|therefore it tries to parse the string to a double. |
'|Solution: always use '&=' to concatenate with strings. |
'----------------------------------------------------------------------------------------------------------------
For i As Integer = 0 To oBitArrayOR.Count - 1
TextBox1.Text += i'oBitArray1(i) + " OR " + oBitArray2(i) + " = " + oBitArrayXOR(i) + "\r\n"
Next
BUT
Dim x As Integer
Dim s As String = s
x = 1
x += 3
s += x
TextBox1.Text = x & " " & s <-- No exception
TextBox1.Text += x <-- Exception
TextBox1.Text += x & " " & s <-- No exception
So, concatenating two strings with '+=' is no problem
|
|
|
|
|
So, is there is question in this, or what? There are no bugs with these operators.
The '&' and '+' operators are fully documented here[^] in the VB.NET Language Concepts reference.
If you use the '+' operator to concatenate strings and numbers, you have to beware of the implicit conversions involved when using it, all of which are documented here[^]. If you use the '&' operator, any operands that are not already Strings are always converted to Strings before the concatenation takes place.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I just want to comment that you can also create your own implementation for the operators in your classes...
Here is a tutorial I found by using Google: Here[^]
other tutorials can be found over Here[^]
|
|
|
|
|
Don't tell me that, tell the OP!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hehe,
I just replyed to the wrong messege... sorry
|
|
|
|
|
Hello all,
I'm new to DirectShow application. I've build a normal application that can run .avi file. I've got an error in RenderFile(), like problem in file loading. so please anyone can help me out how to solve this problem? File path is correct and to load .jpg file it's working fine but in loading .avi files I got problem.......And ya I'm building this application in C# using visual studio 2005.
Please reply soon...
Thanks for reading my question...
alpa shah
|
|
|
|
|
hi
i am creating an application that gets the time from server and sets its time according to this time,, but the problem is that i cannot give adminstrator rights to the user on the client side so just because of that i cannot change time with my c# application because the user who is using this application in the client side does not have administrator rights,,
so is there any other way to change the system time while the current user does not have the administrator rights
thanks in advance
hello
|
|
|
|
|
No, there is no other way to do it. If the user doesn't have the rights to change the system time, he/she isn't going to be able to change the system time, no way, no how. Your application MUST be running in the context of the administrator, or Power User, account to change the time. Since any application runs with the same security context of the account that launched it, it has the same priviledges and restrictions as that account.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi all,
I have to implement Pull printing or Driverless printing concept in my .Net application on a web based client server architecture. Can anyone assist me with the technology to be used and how shud i go about it. I hv no clue!
|
|
|
|
|
can any body tell me a proper method of implement paging in gridview if gridview's datasource is datareader.
neetu
|
|
|
|
|
I have developed a .net project. I want to build it from MS-DOS prompt not from the SDK dos prompt. Can anyone give me a solution for this.
thanks
kavitha
|
|
|
|
|
I would guess that the main thing the SDK prompt gives you is the ability to call the build tools, etc, without specifying the full path.
Christian Graus - C++ MVP
|
|
|
|
|
On my machine the C# command line compiler for .Net 2.0 is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe
Add a /? parameter to get the command line options. There is also Visual Basic (vbc.exe) and a J# (vjc.exe) compilers the same directory. Each version of the framework contains the appropriate command line compilers. A notepad warrior can code without even purchasing an IDE.
|
|
|
|
|
You cannot compile ur .Net projects from MS-DOS prompt.
.Net SDK tools are only available at SDK Command Prompt.
To make it work with MS-DOS prompt is not a big deal you need to set the .Net environment variables by executing the batch file, usually found at
"C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat"
|
|
|
|
|
Hi, I am using MySql ODBC driver for connectivity with MySql database and my VC++.NET application. Now when I am using odbcDataReader to read some data some time I need to use another odbcDataReader for another table. But this gives me run time error “There is already an open DataReader associated with this Connection which must be closed first.” Can I know how can I use 2 odbcDataReaders at same time, or any other method to do this? Thanks in advance.
|
|
|
|
|
The error gave you the solution! Open up another connection for the second DataReader.
|
|
|
|
|
An application, builded with the Visual Studio 2003 Setup, runs fine on a user machine, if the user has Admin privileges, but if the user has only user priviledges, a doubble-click on App-icon do not start the App.exe but seeks for the App.msi - and stops with fatal error.
Did I something wrong?
Ariadne
|
|
|
|