Subscription services

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robertybob
    New Member
    • Feb 2013
    • 116

    Subscription services

    Hi

    I am writing an application for download that requires a subscription in order to continue to work.

    My ISP says that accessing my web-based database from a desktop application is not allowed for security reasons.

    I now have no idea how companies monitor the use of their applications if they can't check their database whenever the application is run. I use a few programs that do this and I assumed they just checked a username against their db to allow the form to run. But seems not.

    Can anyone let me know what the accepted method is to do this?

    Many thanks!
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Just because your ISP doesn't allow you to do that doesn't mean all ISPs forbid it. Besides, even if the ISP won't allow you to remotely access the database, there's nothing to prevent you from creating a web interface to the database. Like a PHP page that does the check against the database instead of the application connecting directly to the database.

    Comment

    • robertybob
      New Member
      • Feb 2013
      • 116

      #3
      Thanks Rabbit.

      Do you mean have a hidden browser page within the application that refers to a PHP page that can use localhost to get the data?

      Also, if I use a PHP page like this to retrieve data, how do I get the data back into the main code for use? ie, if PHP page goes to db and checks subscription and the response is 'ok', how do I return that 'ok' to a format that the rest of the vb code can read?

      All the best.

      Comment

      • robertybob
        New Member
        • Feb 2013
        • 116

        #4
        Ok I've worked out the method to read the php output generated by a page I think so will try to see if this method of a browser object can solve my issue. Thanks again.

        For those interested in the code here is a basic snippet.

        Code:
        Imports System.Net
        Imports System.IO
        
        Public Class Form1
            Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                Dim myRequest As HttpWebRequest = WebRequest.Create("http://www.example.com/hello.php")
                Dim myResponse As HttpWebResponse = myRequest.GetResponse()
                Dim myReader As New StreamReader(myResponse.GetResponseStream())
                Dim phpOutput As String = myReader.ReadToEnd()
                MsgBox(phpOutput)
            End Sub
        End Class

        Comment

        Working...