6 Replies - 762 Views - Last Post: 10 May 2013 - 03:00 PM Rate Topic: -----

#1 HareCoder  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 05-September 12

Kiosk Application Question/Problem

Posted 10 May 2013 - 10:02 AM

Hi,

My employer has requested an application be built that will allow them to sign in automatically to a website they use quite frequently for ordering and such. I have that program built. They then asked if I would disallow the use of other programs on the machine this program is running on (pretty much making this machine a kiosk for ordering). I did that simply by setting the TopMost property to True. The program requires a password to exit (considering I removed the red X and the minimize buttons from the window, I thought this the best way to exit for them). This was put there to keep other employees from simply closing the application and doing whatever they wanted to on this computer. The manager has forbid any use of other programs (mainly to stop people from using Facebook on this computer and closing her application down; my boss is NOT computer savvy AT ALL...I mean it. If you told her to press escape, she'd look at you funny...so when I ask her to open the program back up, she has no idea what I'm talking about...I think you get the gist).

Here's where my issue resides. The website they use to do price checks contains pictures that, when clicked, open a new window. However, due to the TopMost property being set, these windows cannot be seen. What can I do to override the TopMost property for these types of windows? I would allow Alt+Tab, but this defeats the purpose of being unable to close the application out. Being able to code another form is also close to impossible considering these pages are requested from a webpage and the URL changes with each login (it adds the current session code to the web address, so each login is unique). What would be the easiest way to go about this?

I am unable to share much if any of the code due to it containing personal information as well as pretty sloppy coding (yeah, I'm a little bit of a beginner at this). Any code I can share to help, I will.

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Kiosk Application Question/Problem

#2 HareCoder  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 05-September 12

Re: Kiosk Application Question/Problem

Posted 10 May 2013 - 12:10 PM

What would be easier is the code to override the TopMost property if a pop-up occurs. A pop-up will only occur while they are using the application and the price check anyway, and the pop-up that opens doesn't allow internet address entry (so far as I know). I could just implement it as an If...Then statement.
Was This Post Helpful? 0
  • +
  • -

#3 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Kiosk Application Question/Problem

Posted 10 May 2013 - 01:29 PM

Can we assume you are using a WebBRowser control in VB.Net? If so, you have complete control of the operation.

Without some code, it's pretty difficult to help. You should definitely not expose any personal information, but don't worry at all about the quality of your code. We are here to help, and I'm sure there are a lot worse examples than yours, and we are happy to help improve that code while teaching techniques to improve coding.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Kiosk Application Question/Problem

Posted 10 May 2013 - 01:30 PM

.. or do what admins of a system do and go into the controls and lock things down through judicious use of active directory, etc.
Was This Post Helpful? 0
  • +
  • -

#5 HareCoder  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 05-September 12

Re: Kiosk Application Question/Problem

Posted 10 May 2013 - 02:31 PM

Thank you for the replies!

Yes, it is safe to assume I am using a WebBrowser control. Here is my code. The parts I have to edit out are marked as [CONFIDENTIAL].

Public Class mainForm

    Dim GroupNumber As String = [CONFIDENTIAL]
    Dim AccountName As String = [CONFIDENTIAL]
    Dim AccountPassword As String = [CONFIDENTIAL]
    Dim PASSWORD As String = [CONFIDENTIAL]

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate("http://[CONFIDENTIAL]")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If WebBrowser1.document.GetElementById("[CONFIDENTIAL]") IsNot Nothing Then
            WebBrowser1.document.GetElementById("[CONFIDENTIAL]").SetAttribute("value", GroupNumber)
        Else
            MsgBox("You must click #1 first!", MsgBoxStyle.Information, )
            Exit Sub
        End If

        If WebBrowser1.document.GetElementById("[CONFIDENTIAL]") IsNot Nothing Then
            WebBrowser1.document.GetElementById("[CONFIDENTIAL]").SetAttribute("value", AccountName)
        Else
            MsgBox("You must click #1 first!", MsgBoxStyle.Information, )
            Exit Sub
        End If

        If WebBrowser1.document.GetElementById("[CONFIDENTIAL]") IsNot Nothing Then
            WebBrowser1.document.GetElementById("[CONFIDENTIAL]").SetAttribute("value", AccountPassword)
        Else
            MsgBox("You must click #1 first!", MsgBoxStyle.Information, )
            Exit Sub
        End If

        If WebBrowser1.document.GetElementById("[CONFIDENTIAL]") IsNot Nothing Then
            WebBrowser1.document.GetElementById("[CONFIDENTIAL]").InvokeMember("click")
        Else
            MessageBox.Show("You must click #1 first!", "Incorrect Button Order", MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End If
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        WebBrowser1.Navigate("http://[CONFIDENTIAL]")
    End Sub

    Private Sub mainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If TextBox1.Text <> PASSWORD Then
            MessageBox.Show("You are trying to close the program without entering the password." & vbCrLf _
                            & "Ask the System Administrator or Management to enter the password.", "Prohibited Operation", _
                            MessageBoxButtons.OK, MessageBoxIcon.Error)
            e.Cancel = True
        End If
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If TextBox1.Text = PASSWORD Then
            Me.Close()
        ElseIf TextBox1.Text <> PASSWORD Then
            MessageBox.Show("Incorrect Password. Please contact your System Administrator" & vbCrLf & _
                            "or Manager to enter the correct password.", _
                            "Incorrect Password", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            TextBox1.Focus()
        End If
    End Sub

    Private Sub Form1_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Move

        Me.Top = 0
        Me.Left = 0

    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

        If CheckBox1.Checked = False Then
            If TextBox1.Text <> PASSWORD Then
                MessageBox.Show("Enter the Exit Password first, please.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Hand)
                TextBox1.Focus()
                TextBox1.Clear()
                CheckBox1.Checked = True
                Exit Sub
            End If
            Me.TopMost = False
        ElseIf CheckBox1.Checked = True Then
            Me.TopMost = True
        End If
    End Sub

    Private Sub mainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CheckBox1.Checked = True
    End Sub
End Class



As I said before, it's pretty rough, but it was thrown together rather quickly so as to please the almighty Boss. A BUNCH of it is poorly used ways of preventing the screen from being moved around, keeping it as the topmost screen, not being able to exit the program without a password, etc.

Originally, for the first part, I wanted to be able to make the program go directly to the website from one button click and the rest take care of itself automatically using DocumentCompleted, etc. However, there was no easy way to implement that, and each login greets you with a fresh URL with random generated IDs, so no copy/pasting the URL into the code, only certain parts. Also, I am nowhere near knowing how to make it click on a certain link that way because all of the links inherit the new URL with the random ID. So that's why it looks like it does.

Also, some people were clicking the buttons out of order (even though I went so far as to number them for them...*sigh*) so I had to implement my own exception handling and error messages. Don't laugh at them too hard.

So that's where I'm at right now. Any ideas are appreciated.

As far as AD DS is concerned, I'm no software guru and nowhere near the level of some people with the ins and outs of operating systems. So that wasn't even my first thought. I may implement that in the future, but, and this is probably funny to most, the server isn't actually within easy access to ME, the sysadmin...nope, our account manager has the server at their desk...who knows nothing about how to run a server except checking e-mail and other simple things. So that's part of the reason AD DS wasn't my first thought. That and I don't know enough about it to really implement it effectively. This was just for one computer in the store to become basically an order machine for the boss.

Thanks again!
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8915
  • View blog
  • Posts: 33,427
  • Joined: 12-June 08

Re: Kiosk Application Question/Problem

Posted 10 May 2013 - 02:48 PM

Well you may want to look into it. I mean you go try and cobble something together with an app that tries to over ride an asinine amount of edge cases, or do a quick search, set up an account on the machine (for her to log into), and flip some settings.

http://jaredheinrich...to-a-kiosk.html
http://helpdeskgeek....d-7-as-a-kiosk/

so.. just walk over there and follow the instructions.
Was This Post Helpful? 0
  • +
  • -

#7 HareCoder  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 05-September 12

Re: Kiosk Application Question/Problem

Posted 10 May 2013 - 03:00 PM

View Postmodi123_1, on 10 May 2013 - 02:48 PM, said:

Well you may want to look into it. I mean you go try and cobble something together with an app that tries to over ride an asinine amount of edge cases, or do a quick search, set up an account on the machine (for her to log into), and flip some settings.

http://jaredheinrich...to-a-kiosk.html
http://helpdeskgeek....d-7-as-a-kiosk/

so.. just walk over there and follow the instructions.


Like my post stated in the first few words, this was an APP requested by the boss. Those things you posted I already knew, but as I'm still learning VB, I felt writing an app would be much more fun and challenging, plus it was requested.

Really and truly, all of it has been bypassed. If it weren't for the fact that the computer has to also be used for things, by me, other than ordering, there wouldn't even be a password scheme setup. It would just be the application loading up at startup and that's it, no exiting the app, nothing. I would have implement a shutdown procedure at closing time, and everyone would be happy. However, the password part was easy to code in (for the most part) and clearing the red X and minimize buttons were really just "click this, set to False." Easy. So AD DS may be what you'd prefer, but not something I wanted to do, nor what I was requested to do...

So...any other assistance that's related to my code or VB and not hassling me to do AD DS or other OS related things? If I wanted to do that, I'd have posted in another forum.

Thank you for the advice, though. I didn't intend to be rude (it probably comes off that way, though). It's something to consider next time I do this for other computers either at the office, home, or for a client.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1