|
You're service has to be tagged to work with the desktop. Go into the Services manager, select your service and get Properties on it. Then click on the Logon tab and check the box labeled "Allow service to interact with desktop".
After that, you're service can put up dialog windows and MessageBoxes all you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I do like you say , with log on as Local System and check to "Allow service to interact with desktop" , but it do not show message ,
Why it be show , tell me more please .
Thanks
|
|
|
|
|
What are you using to show the "message"?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey, as a school assignment I have to write a program for a Rent-a-car company and I am having trouble writing the pseudocode for it.
Firstly a login screen will be displayed, then once the login has been successful it will take the user to the main menu which will then display 3 options:
1) View vehicle database
2) View customer database
3) Quick Rent a vehicle
So far i have been able to write the following pseudocode: (frm = form)
Read LOGIN
If username = "Torr" AND password = "hurtz"
THEN Unload Loginfrm
Show MainMenufrm
I dont know how to write the next bit that allows the user to choose one of the options of the main menu, could anyone please help?
Thanks for your time
|
|
|
|
|
Pseudocode (or p-code) is simply writing down the logic of the program in a way that is readable by humans but is not necessarily valid computer code.
In this case you need to write the logic of what you want to achieve in English which can then help you to translate this to VB, C#, C++ or whatever computer language in which you are writing.
I do this all the time (well mostly ) but especially when I need to specify some logic to a junior programmer without actually writing any code myself.
Everyone's style of writing p-code will be different so don't take what I write here as gospel - you will soon find out what does and does not suit you.
You are on the right track with the login form, but may I suggest this:
[Main Program]
initialize any global variables
display Loginfrm
[Loginfrm]
When the Login button is pressed
begin
read the username and password
if the userid and password are valid then
hide Loginfrm
display MainMenufrm
endif
end
when the "Exit" button is pressed
begin
End program
end
[MainMenufrm]
when the "View Vehicle Database" button is pressed
begin
hide MainMenufrm
display ViewVehiclefrm
end
when the "View Customer Database" button is pressed
begin
hide MainMenufrm
display ViewCustomerfrm
end
when the "Quick Rent" button is pressed
begin
hide MainMenufrm
display QuickRentfrm
end
when the "Exit" button is pressed
begin
hide MainMenufrm
display Loginfrm
end
As you can see some of the detail is starting to emerge and points where additional detail is required are being identified. Writing p-code is an iterative process and you can continue down this path to the 'n'th degree. In the above example p-code may need to be written for the QuickRentfrm , ViewCustomerfrm and the validation logic around the userid and password entry, etc. to tease out the details of their operation too.
Best of luck with the assignment.
...Steve
|
|
|
|
|
Thanks alot for your help
|
|
|
|
|
Not a programmer, so there's probably an easy answer to this one. Trying to write some code to automate a process by starting an external program in vb.net, using sendkeys to perform some tasks, and close. The problem is that when I start the program using shell, or process.start(), it starts with no registry info. It starts the program like a brand-new install(wanting user info and software-key info). I've experimented with using runas from the command line, and it does the same thing no matter which user I run it from... however, if I run it from the command line by just typing the path&file name, then it loads normally.
Been searching for a couple days now on the web for an answer to this... in my sample I can open notepad and send it stuff with no problem--and I think the rest can be figured out if I can just get the program to run as normal, instead of starting as a new install.
Thanks for any help.
|
|
|
|
|
As I suspected, it was something silly. To answer my own question just for the benefit of other novices like myself, this code does the trick:
Dim myProcess As Process = New Process
Dim pi As New System.Diagnostics.ProcessStartInfo
pi.FileName = "appname.exe"
'I didn't use any arguments--but they go here
'pi.Arguments = "c:\first.doc"
pi.WorkingDirectory = "c:\program files\appsubfolder\app\"
pi.WindowStyle = ProcessWindowStyle.Maximized
myProcess.Start(pi)
Setting the working directory fixed it. From there, it appears that sendkeys.sendwait is going to perform the automation items the way I need it to. Thanks.
|
|
|
|
|
Hello everybody, I am looking for a tic tac toe code sample in vb.net using arrays in a windows application. It also should allow two human players and use integer arrays. If you have the code I'd appreciate if you send it to me, thanks in advance.
|
|
|
|
|
|
can any one tell how to pass the 2 url in a funcion say i have a function which check the url is valid r not thro http respnse if i give 2 url together i need my application to check the url 1 by 1 this is the code snippet
Public Function checkurl(ByVal url As String) As String
Dim req As System.Net.HttpWebRequest
Dim res As System.Net.HttpWebResponse
Dim r As System.IO.StreamReader
Dim ex As Exception 'error exeption holder
Dim pge As String 'page holder
Dim title As String
Dim strreturnstring As String
url = "http://www.yahoo.com"
' i need to pass 2 url like "http://www.sg/" and "http://www.yahoo.com/"
Try
'display request url
req = req.Create(url)
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"
req.AllowAutoRedirect = True
'get page
res = req.GetResponse()
r = New System.IO.StreamReader(res.GetResponseStream())
'pge = r.ReadToEnd
r.Close()
res.Close()
strError = "OK"
status = "True"
'Convention is First Value is the Status and Second value is Errmsg
strreturnstring = status & "~" & strError
Return strreturnstring
Catch ex
status = "False"
strError = ex.Message
strreturnstring = status & "~" & strError
Return strreturnstring
End Try
End Function
any suggestion pls it urgent
Regards
ybasha
|
|
|
|
|
Hello..
I just need to know..I already can read the IC number name from the MyKAD(smart card).
The result that I get is below:
ANG SWEE LEONG 711223105477
The question is, how am I going to remove the "[]" symbol in that data?
I use the source code below to print out the data
For Counter = LBound(abyRecvBuffer3) To UBound(abyRecvBuffer3) Step 1
Result = Result & Chr(abyRecvBuffer3(Counter))
Next Counter
ReadName = Result
The data that I get is correct, but the problem is the symbol "[]" appear at the website, so I cannot get the catual data.
Notes: The data is in Hexa format, I convert it to Char.
Izyani-
|
|
|
|
|
Dear All!
I need to design an application in VB.NET that can take input from the BarCode reader device and then perform certion steps.
My problem is that when the BarCode is scanned i need to catch that event...
i.e the user comes and scan the Barcode....Now the system will detect that a Barcode is scanned and I have to move forward to other form or what ever.
This is to be noted that the user will not press ENTER etc when the barcode is scanned rather the System will detect itself............But How??????
Thanx in Advance
_mubashir
Why it is called BUILDING when it is already BUILT.
|
|
|
|
|
This really depends on the type of brcode scanner you are using. They are normally either serial or keyboard wedge. Keyboard wedge scanners are most common (probably because they are cheaper and easier to set up).
In general you would have an invisable textbox with the focus set to it . A keyboard wedge scanner basically converts whatever it scans into a simple keyboard input so when an item is scanned the text appears in the textbox. you can then capture the changes event for this textbox and validate the input. When you set up the scanner you set a character so you know the text is from the scanner.
Jon
|
|
|
|
|
Hmm.....
Thanx for ur advice......
But what the hidden textbox is for?????
and also when I put a text change event on the textbox......should it be raised for each character scanned by the scanner.......OR it will raise a single event for the Barcode scan
_mubashir
|
|
|
|
|
The hidden textbox has focus so it recieves the text string from the barcode scanner. It could easily be not hidden but we use it in a POS so it is hidden. the textchange will fire for each character but the scanner should append a particular character to mark the end so you simply check for the first character to confirm it is a barcode then check for the last character which you know marks the end of the barcode. You can then do whatever with the barcode and clear the textbox.
Jon
|
|
|
|
|
Yah now i have a better idea...Thanx
Do me one more favour.........tell me how to append characters at the start and end of the input barcode.....
_mubashir
|
|
|
|
|
That is in the documentation you get with the hardware. It also tells you how to set it up for different languages.
Jon
|
|
|
|
|
Hi
I am developing on Visual Studio 6.0 and VB.Net.
I am looking for a form or code that look like the Microsoft Outlook Appointment recurrence that will be part of my application without working with Microsoft Outlook.
I found aritcle in CPP: http://www.codeproject.com/datetime/daterecur.asp?df=100&forumid=3654[^]
and it is exactly what I need but I cannot work with it because it is write in CPP and MFC.
Please help me to find a solution
Thanks
Sigalit Dekel
|
|
|
|
|
I am building a VB.Net client application. On one form, I have an AxWebBrowser control that I am using to render an HTML form. The application also lets the user select a default Printer and Fax from the available printer drivers, but maintains these defaults within the application and not using Windows standard functions. (I recognize this is not good, but we have requirements that force us outside of the standards).
Anyway, I have the ability, from the AxWebBrowser control to bring up the standard print dialog. I also have the ability to print directly to the default printer without the standard print dialog. Instead, however, I need to print directly to the printer that the user selected from the application as their standard printer (which may not be the default).
Does anyone have any suggestions on how to do this?
As an alternative, I have found that using the PrintDocument object, I can print to whatever printer I want fairly easily. The problem, however, is getting the HTML formatted into the PrintDocument object. If anyone has suggestions on that, it would be just as beneficial from my perspective.
Any help would be greatly appreciated.
Mike
|
|
|
|
|
I am trying to change the height and width of a label, when I change it in code I get no error but it does not change. Any ideas why?
I am trying to make a tall label (vertical)
lblslots(I).Height = 125
lblslots(I).Width = 15
I can draw on like this on a form.
|
|
|
|
|
Double-check the .AutoSize propety on the label, I believe it's set to TRUE as a default.
|
|
|
|
|
Thanks, that is the ticket...
|
|
|
|
|
Trying to convert the output string from datepicker to an integer value,
pick oct10 through oct12 = 2 days...
Trying to use DateDiff...seems to be the right direction, just need some
help with syntax - i.e. DateDiff = (dateinterval.day, datestart,dateend)
Thanks
-- modified at 11:33 Monday 10th October, 2005
|
|
|
|
|
the general format is DateDiff("S", OneTime, OtherTime)
more info at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctdatediff.asp
|
|
|
|