|
I am developing a windows service which would check if a particular program is running and if not start the program as an application.
But I cant seem to able to get it.
I have used "Shell" but the service starts the program as a service running in the background and not as an application. How do I do that?
|
|
|
|
|
It's not working because the service is running on it's own desktop, not the one the user sees.
Currently, the .NET FCL does NOT support services that interact with the user desktop. You would have to P/Invoke the CreateProcess function to launch the app, but that would also require that the service runs under a user account and not the LocalSystem account.
RageInTheMachine9532
|
|
|
|
|
In my resize event i use Height to change the height of the object but i see that sometimes ScaleHeight is used. Why? What's the difference?
Grtz,
Guus
|
|
|
|
|
Use the Height, Width, Left, and Top properties for operations or calculations based on an object's total area, such as sizing or moving the object.
Use the ScaleLeft, ScaleTop, ScaleHeight, and ScaleWidth properties for operations or calculations based on an object's internal area, such as drawing or moving objects within another object.
RageInTheMachine9532
|
|
|
|
|
Before someone says something, I can´t use SSTab component. We are replacing all Sheridan components in our system.
I have a tabstrip with 5 tabs and a control array with 5 frames. For each tab there is a frame. When you clicks in a tab, it should show the relationed frame. But only the first frame is shown.
I debugged the code and I saw that the visible property of the second, third, fourty and fifty frames is not being changed.
The line below:
Frame1(n).visible = True
It only works for the first frame.
I don´t know what I do.
Flávio Gomes da Silva Lisboa
Programmer Analyst
|
|
|
|
|
CORPORACAONF wrote:
a control array
Leads me to believe that your using VB6...
CORPORACAONF wrote:
For each tab there is a frame. When you clicks in a tab, it should show the relationed frame.
Why are you using an array of frames? Each frame should go on it's own tab page. When the user clicks the tab, the appropriate tabpage is automatically shown. You don't have to do enything to manage the Visibility of the frames.
Now, if you are switching frames that are not on the tabpages...
Your are setting the Visible property to true, but this doesn't NOT bring the frame to the top of the stack of frame, if they are on top of each other. You must set the Visible property of the frame that is being hidden to False. That way your visible frame will show even though it has other, non-visible frames on top of it.
RageInTheMachine9532
|
|
|
|
|
I am trying to create the add-in for some application and want to get the even
when the active document is closing. How can i get the even when active
document is closing?
Thanks for your help in advance.
Shinya
|
|
|
|
|
Hi, I'm a newbe and need some help. I'm trying to write some code (in vb.net) to get the ntid of the last user to modify a specific file.
Thanks for your help.
|
|
|
|
|
That's easy! NTFS doesn't record such information. There's no way to determine what ID that was.
You can get the last modification time of the file, using the FileInfo class, but not the ID of the person who did it. For one, NTFS doesn't track such information since any number of users can have a file open at the same time. And two, the .NET Framework doesn't yet support the NTFS security system. You'd have to P/Invoke a bunch of Win32 functions and structures to get the security information, like what users are AUTHORIZED to open the file, or what have you.
RageInTheMachine9532
|
|
|
|
|
Thanks for the info. I guess i'll have to figure out something else.
|
|
|
|
|
Dear All!
I would like to ask for some help with a project I have in VB .NET
I want to load a picture (BMP or JPG), then to select an area on this picture (by using a kind of selection tool or click on 4 corners) and then to get the size of the selected area.
Any help of how to to it, will make me glad!
Thanks in advanced!!!
Tom Rahav.
|
|
|
|
|
Read about GDI+ . I'm new to graphics too in vb.net as well.
Also, http://www.dotnetforums.net/
that site has a forum devoted to graphics. You might be able to find info there.
|
|
|
|
|
I am calling a VB6 dll from a vb.net windows application that returns an array of strings. My issue is it seems to truncate after a NULL character.
For Example VB 6 is returning a string with the HEX value of 4E 31 00 00 01 00 20 20 20 20 20 00 00 00 20 20 20 31 32 30
But when it gets back to Vb.net all I have is 4E 31 or “ N1”
Now I can return the same string as a return value of a function and I get it all.
Please Help,
Patrick Horn
|
|
|
|
|
Hi,
I have developed several VB6 components that 'run' on a server on behalf of client application requests. So far so good...
Now we move to a Win2k cluster in order to enhance availability.
What _can_ i do or _should_ i do to make my own server components working in a fail over scenario? Just cannot find anything usefull at MSDN.
Tia Aad Slingerland
Aad Slingerland
Zevenaar
The Netherlands
|
|
|
|
|
Hi,
I am trying to insert a value into a access database field but the value i am tyring to insert has an ' in it and i think that is what is causing the problem. for example
dataadapter.insertcommand.commandtext = "insert into table1 (clientname) values " & txtclient.Text & ""
I think that if the user enters something with a ' in it i get an error. Can any one please let me know if i am right and how to fix it?
Thank you,
Santana
|
|
|
|
|
you need to replace the single quote with 2 single quotes.
insert into table1 (clientname) values ('o''neil')
|
|
|
|
|
What if i am getting the data from a textbox?
Thank you,
Santana
|
|
|
|
|
do this first
textbox1.text = replace(textbox1.text,"'","''")
or
replace(textbox1.text,"'","''")
Marvin N. Guerrero
- Casting More!!
|
|
|
|
|
When you're done, please let me know the URL to your website, so that I can practise SQL injection attacks and delete your database.
Thanks in advance,
Steve
|
|
|
|
|
Use parameters so you don't have to worry about escaping your input. It's also safer than concatenating SQL statements.
Charlie
if(!curlies){ return; }
|
|
|
|
|
Here you go. Just use these prior to saving or retrieving any text field.
Friend Function SingleQuoteTextFromDB(ByVal text As Object) As String
'If a user saved a single quote in a text field, it was changed to
'2 single quotes. This function reverses the changes when displayed
If Not text Is Nothing Then
If Not text Is DBNull.Value Then
If InStr(text, "''") Then
Return Replace(text, "''", "'")
End If
End If
End If
Return text
End Function
Friend Function SingleQuoteTextToDB(ByVal text As String) As String
'If a user enters a single quote in a text field,
'This will replace the single quote with 2 single quotes
If Not text Is Nothing Then
If Not text.Length.Equals(0) Then
If InStr(text, "'") Then
Return Replace(text, "'", "''")
End If
End If
End If
Return text
End Function
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
The values aren't actually stored with the second quote, therefore values don't need to be decoded after being retrieved from the db.
|
|
|
|
|
Thanks for all the help Guys, i used the replace method that Guerven suggested.
Santana
|
|
|
|
|
I am trying to write a code for enabling and disabling a textboxes for output and for input during certain times in the program.
One of my textboxes is PartNumber.text. At the beginning of the program I want to disable this box; however, if they want to add another Part this box will become clear so they can input a number so I want it to be enabled.
I am confused on how to write it.
Thank you,
ibok23
|
|
|
|
|
You use the Enabled property of the TextBox control. When to enable it and disable it depends on your design.
If I remember right, you were using menus to do Add, Delete, ...
If the Click handler of the Add MenuItem, you would use something like this:
Private Sub mnuAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAdd.Click
txtPartNumberTextBox.Enabled = True
... the rest of your code to enable controls and buttons goes here ...
End Sub
The user would have to click some button you have on your form to tell your app that all the data is entered and to process it to add it to a database. This button has a Click handler. This is where you would disable the textboxes and buttons you need to:
Private Sub btnAddData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddData.Click
txtPartNumberTextBox.Enabled = False
... the rest of your code to disable controls and buttons goes here ...
... also the code to process the data to add goes here...
End Sub
RageInTheMachine9532
|
|
|
|