locked
How do i connect to my online websites MySQL database? RRS feed

  • Question

  • I have been on this problem for a couple of days now, and i have tried a lot for help. No matter what i found, i didn't help.
    So now i've come here, hoping there's some C# smartasses out there to help me out ;)
    ______________________

    My problem is, i'm trying to make a Windows Forms Application.

    Form1 (which is the first to appear);
    Form1 shows 2 textboxes and a button. The 2 textboxes are for "Username:" and "Password:" and the button is for "Login".
    Right now i have just made it check if the username is "User" and the password is "Pass" though, until i get any further.
    Once logged in, it shows Form2 - which technically is my application.

    But the close-up problem is, i want it to check if the written Username and Password is the same as ones Username and Password on my websites forum (phpBB3) and of course this means i have to establish connection to my sites MySQL. 

    I have a script that should work, but when i run it, it shows the error: "Unable to connect to any of the specified MySQL hosts."

    Here's my code, i thought you might want to have a look at it:
            private void button2_Click(object sender, EventArgs e)
            {
                string MyConString = "SERVER=localhost;" +
                "DATABASE=mydatabase;" +
                "UID=testuser;" +
                "PASSWORD=testpassword;";
                MySqlConnection connection = new MySqlConnection(MyConString);
                MySqlCommand command = connection.CreateCommand();
                MySqlDataReader Reader;
                command.CommandText = "select * from mycustomers";
                connection.Open();
                Reader = command.ExecuteReader();
                while (Reader.Read())
                {
                    string thisrow = "";
                    for (int i = 0; i < Reader.FieldCount; i++)
                        thisrow += Reader.GetValue(i).ToString() + ",";
                    listBox1.Items.Add(thisrow);
                }
                connection.Close();
            }
    At the top, below "using System;" i also have this included: "using MySql.Data.MySqlClient;" which a guy told me to download and use as a reference.

    Do you understand my problem?
    ::
    Lets say a user on my forum has this account:
    Username: User123
    Password: user123pass

    Then if i typed in "User123" and "user123pass" then it should check if this login is the same as one on my forum, and if it is then let me log in and show Form2.

    Please help me as fast as possible :)

    Thank you.
    Wednesday, January 13, 2010 7:16 AM

Answers

  • set a breakpoint at the document completed event declaration (first line) to see if it hits.  i assume it won't since you are not getting any messageboxes but this will get you in the habit of trying to track down issues using breakpoints.

    next thing i might suggest it to completely delete the document completed event, double click the webbrowser control on the form and this should write the event for you.  add the messagebox code to it again.  just the messageboxes, do not paste then entire event code again.

    see what happens then.


    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    • Marked as answer by Harry Zhu Tuesday, January 19, 2010 3:08 AM
    Saturday, January 16, 2010 2:00 PM
  • Ok,

    first, glad you got it working

    second, we are going a little bit far in this thread.  not a big deal but the forum prefers to have a single question per thread.

    i will go ahead and address your last questions and then you should start new threads for each specific question you have.  this will help others as well.


    #1
    this is a little bit tricky in c#.net.  vb.net has this setup for you to select from the application properties to handle the shutdown mode based on the first form or last form closing for you.

    so what you need to decide here is do you want to control this and close the first form after you show the second one or do you want to just hide the first form.  hiding is not big deal, you can use   this.hide();  or this.visible = false;  and those will hide the form.

    to close the first form will require some modification to the run command of the form in the program.cs file.

    here is an example to modify the file so that it will not shutdown when you close the very first form that is loaded

    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
    
    namespace test_C_Sharp_app
    {
        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //Application.Run(new Form1());
                Form startform = new Form1();
                startform.Show();
                Application.Run();
            }
        }
    }
    

     
    you can see the original line that i commented out whcih will pass the new form1 to the run method.  i added the 3 lines following that to create a new instance of form1, call the show method and run the application without anything passed in.

    now you can show the second form and close the first form without shutting down the application.  the only drawback here is you need call application.exit() from your last for whenever you are ready to close the entire application, otherwise the applicatioin will continue to run even though you close all forms.

    you can handle this in the formclosed event of you second form also by calling application.exit();



    #2
    application.exit(); will close the entire app which would also close form1 if it was hidden.

    #3
    we already discueesed this earlier.  we talked about the webbrowser getelementbyid.   you can do some web and forum searching on that.  i would help you on that one but i am just not ready to get into that this morning.  the weekend, although i still work, tends to be a time my brain doesn't want to go full blast; it needs some down time.



    now keep in mind with the program.cs changes if you go that way, you need just modify it, as you have seen already, sometimes copy and paste does not translate well.

    alright, well this should get you going for today.  do what you can and if you have more questions, start new threads for each question.

    Peace


    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    • Marked as answer by Harry Zhu Tuesday, January 19, 2010 3:08 AM
    Saturday, January 16, 2010 3:23 PM

All replies

  • Is this the same connection string that your website is using?  If so, is your website running on your workstation or is the website and database running on a server someplace?  If this is not all on your local box then SERVER=localhost definitely needs updating.
    jon.stromer.galley
    Wednesday, January 13, 2010 3:58 PM
  • "Is this the same connection string that your website is using?"
    A: I don't really know..

    "is your website running on your workstation or is the website and database running on a server someplace?"
    A: My website and database are running on my hosts (paid host) server

    "If this is not all on your local box then SERVER=localhost definitely needs updating."
    A: Local box? Every tutorial i have read stated, and i quote: "If your database is on a paid host, then 'SERVER=localhost' is what you need." ..

    __________

    Can you help me make this work, possibly/please?

    Thank you for your reply
    Wednesday, January 13, 2010 4:09 PM
  • "SERVER=localhost"

    Is saying that this application will find the database to be running on the same box as the application.  That is "probably" true for a website and database hosted on some paid provider.

    It would also be often true when you are developing.  It would not be uncommon for your workstation to run an application, your website and development database.  In that case the above specification would also be good.

    What would not work (as you have found) is an application running on your workstation looking for data on a remote server.  In that case, you need something more like:

    "SERVER=myhosting.com:64333"

    Your provider would be able to give you the correct connection string IF they allow remote connections to the database.  That is a big IF I think.

    If not, you would need to write a web service to expose your data.

    jon.stromer.galley
    Wednesday, January 13, 2010 4:17 PM
  • ""SERVER=myhosting.com:64333" Your provider would be able to give you the correct connection string "
    A: Exactly which connection string? And do you think you can make a code, that only needed that connection string (which i can get from my host?). The connection string - is that like "myhosting.com:XXXX" or "mydomain.com:XXXX"?

    -- So my host has that XXXX number?
    Wednesday, January 13, 2010 4:27 PM
  • Your hosting company would be able to provide the "fully qualified domain" name (www.myhosting.com) or ip address and a port number (the :XXXXX part).  That is if they allow the database to be exposed to the internet.
    jon.stromer.galley
    Wednesday, January 13, 2010 5:07 PM
  • All right i will check with them.

    Can you create a code that will establish connection to my database? Or maybe just show me the fields that are wrong my current code and what i have to put in at those wrong fields? (Example: www.myhosting.com:XXXXX)

    Thank you :)


    EDIT:
    I have an IP which should be my MySQL Server. I logged into my PhpMyAdmin to retrieve the information. Besides that, i have, in my activation mail, a note where it says "MySQL. Host: mydomain.com.mysql Database: mydomain_com" and the password.
    Then i logged into PhpMyAdmin and saw this IP address:
    "Server: xx.xxx.xx.xx via TCP/IP"

    By the way, my site is using a phpBB3 forum and i found a file in my database titled "phpbb_users" and a "phpbb_acl_users".
    However, i dont know which file to use and i dont know how to use it properly in the C#.

    EDIT:
    I have tried every possible combination, and none of them makes a connection..
    Wednesday, January 13, 2010 5:22 PM
  • Nevermind, i just asked my host and remote access to the databases arent possible.. 
    Thank you for your help though :)
    Wednesday, January 13, 2010 7:04 PM
  • AC Animate,

    Something that i am starting to do now is integrate web browser controls into my apps.  right now it's just for simple things, for example i have a client application which the user is not able to send out emails from their workstation, so i added a web browser control the the application which loads up my website contact page and they can send me an email through my site.

    For data that i don't want others to be able to see but i want access to i login directly into my website through a browser, peform my query and have the server stream a csv file which i send as an attachment in an email to me.

    What you might consider doing to make this easy on you to start is to integrate a browser in your app to login at your site.  you could possibly just let the user enter the information into a form in your windows forms app and then set the elements of the login page with the entered name and password, perform the login, and finally get the result of the login in an element in the web page.  after this is verified you can show form2.

    hope this helps


    Wednesday, January 13, 2010 8:46 PM
  • If you can't get remote access but you can make a web site then you can expose your database with a set of web services.  You can write them on your own if you want though a product like WebOrb would also work.
    jon.stromer.galley
    Wednesday, January 13, 2010 10:44 PM
  • I think i understood it all.. perhaps.

    So when i type in the login information, and hit the "Login" button, it would show my website when logged in within the form? So that everyone would be able to use it?

    ____

    If yes, i have no idea how to make this. I am a newbie at C#, i started learning (by myself..) a week ago this saturday. But i just love to program, and im gonna get educated within software development. So i wanted to know a few things before i started.

    __

    Sounds really awesome, but i seriously dont have the least idea of how to do it.
    Thursday, January 14, 2010 8:12 AM
  • There are web service and there is Windows Communication Foundation (WCF) as well as mentioned above.  But to start out it may be easier and faster for you to just automate your web page.  I have not worked with the elements but from the examples i have seen it does not look difficult.

    What you could do is load up a hidden webbrowser drug from the toolbox on the login form in your windows forms application or just create one in code which would just reside in memory and not be shown on the form.  This webbrowser will load up your website login page.  You won't need to show the page to the user because you will use the windows form for the user to enter the information to login.

    After the user enters the information and clicks the login button on the windows form, you will enter the information in the webpage textboxes and "click" the web page login button using code.

    The result could be set to a control on the web page which you can check.  you can either wait a little bit of time to check this to let the page refresh using a timer or, use the webbrowser events to know when the page is refreshed, or have the site redirect to a login success or fail page which you can monitor when this is loaded, again, using the webbrowser events.

    What you need to do some searching for is    webbrowser control getelementbyid.  This will help you get started on the process of working with the controls on the web page from your windows forms app.

    also, another suggestion for security purposes is to not use a datareader for your login query results but instead use a count of the records returned that match.  This will just return a number result rather than the actual login information. 

    example

    select count(*) from yourtable where usernamecolumn = @name and passwordcolumn = @pword

    what this command does is let you specify the values for to search for using a parameter (@name, @pword, etc...) and get a count of the records that match the search.  a paramter is just a placeholder that will consider the entered values to be just that, values, and help stop maliscious users from injecting other commands into your command text.  this is a simple step that will save you a lot of grief if ever it was to happen to you.  the parameter names can be anything you want as long as they are unique for each command.

    the way you use the parameters is to add them to your command along with the values

    example

    yourcommandobject.parameters.addwithvalue("@name", yourtextbox.text)

    you need to add all the paramters in your command text to your command object the same way.


    the way you get the results of your query now is to use    yourcommandobject.executescalar     instead of executereader.      scalar will return a single result which will be the first column value in the first row.


    this will be much easier and faster result than what you have not because it will get the result with one step rather than loading up all records like your command currently does.  you get the count right way versus having to check each indidual record you have returned.

    if you need more help on working with paramters and command objects, i have a tutorial on my site called widgets inc project.  It is in vb.net and uses sql server compact but the concepts for sql are all the same whichever database you use.


    Aside from the database parts, the main things is to start doing searches for     webbrowser getelementbyid.    that will help you get started on it. 

    or you can also start looking into web services.

    Hope all this helps


    Thursday, January 14, 2010 3:28 PM
  • I'm sorry, but i probably didnt understand anything at all.. About the sql and database part, as i said earlier, they dont support remote access.

    But i have worked out another way (far from as great), this just goes to my forum website (the login page), when you login you get to a "Login successful" redirecting page. I'm gonna make it check if that page is active, and if it is, show Form 2. Yet, this slow method takes away the good part of my application.

    What you said about the Login boxes matching (this is what you mean, right?) the websites login boxes, and enters the written text automatically when a button is pressed and automatically logs in, sounds great.
    But i have simply no idea how. And all those small pieces of code you put in, i dont get it. I simply dont understand 1 line of code just like that. I have no idea what it does.
    If i see an entire code, then i can sort of figure out what each line does, but 1 by 1 i'm lost.

    And by the way, i have made a web browser but what i need P.T. is a code to check what the current URL is.

    If i type in "google.com" and click images, the written URL will still be "google.com". I've seen all those "Request.Url();" and such, but "Request" is shown as an error..
    Thursday, January 14, 2010 5:22 PM
  • for the sql parts it would be best if you take a look at my database tutorial to understand more in detail.  it explains a great deal about how it all works.  It will help you quite a bit.

    your idea to just navigate to the website and watch the pages is not a bad idea, very easy for now.

    to get the url, you can use the navigation or document events.   in these events you can use    e.url    which will contain the url address.  you can check this address to be sure it matches.  i am going to use a similar process in my application registrations.

    you need to look for an exact url address, google like any site or page can load up different information into a page.  in other words: data in a page can change but the address of the page stays the same.  if your login success depends on an exact page address and not updates on a page then you should be ok.

    main thing you need to do is play with the events to be sure you are getting a full success login load of the page.  it is possible to navigate to a page and it will show you are navigating to it but that doesn't necessarily mean they have logged in.  in your application you have control over this but it is possible to decompile your code and reproduce the program or parts of it.  just keep in mind that it is difficult to fully secure an application, that is why i like the idea of integrating a webbrowser control and use of the web period.  it is much easier to protect information and code if you can run it on a web server versus sending it to someone in an executeable which they have unlimited time to try and break and easy access to.
    Thursday, January 14, 2010 6:39 PM
  • I really appreciate your great attempts to help me out, but i really dont know enough C# to do the most of this.

    I have already tried e.Url but it just emptied my textBox. And my login page is a part of one massive php-file.

    This is how the link looks, which shows the login form: http://(...).com/community/ucp.php?mode=login

    And when i have logged in, it shows a different value for each user (of course) so i don't know how to check for it.

    After login: http://(...).com/community/ucp.php?mode=login&redirect=./ucp.php%3Fmode%3Dlogin
    Here's a link, after login, for another user:
    http://(....).com/community/ucp.php?mode=login&redirect=./ucp.php%3Fmode%3Dlogin%26redirect%3D.%252Fucp.php%253Fmode%253Dlogin

    But as you can see, it is still the same massive php-file. (ucp.php)

    If you guys could tell me how to make it check if user has logged in (if that page is the url) and how to make it show the url..

    As you are reading this, i am of course working on it, searching for answers on google which doesn't help me at all and getting extremely frustrated and in the end, i'll just be waiting for an answer from you guys.
    Thursday, January 14, 2010 7:10 PM
  • well, i had typed out a long response to this and somehow it was lost.  not sure what happened.

    ok, well i won't go over everything again but i will go over the parts you need for now.

    you can use string methods to find out information about the url

    since you are working with dynamic log in information you need to find parts that are constant

    each login looks like this part is constant: http://(....).com/community/ucp.php?mode=login&redirect

    you can use the startswith method to be sure your url "starts with" the above.

    example
    if e.url.tostring.startswith(http://(....).com/community/ucp.php?mode=login&redirect) then
    'you got the page ???
    end if

    now i don't know exactly how your login works but if this will only be a part of the login page if a successful login took place then that might be all you need.  basically you will need to find whatever tells you a successful login was made.  and again you may need to be sure noone can type in this address so that your code things that it loaded the login successfully when it did not.

    for more informtion on strings look here  http://msdn.microsoft.com/en-us/library/system.string.aspx   the functionality section will show you the rest of the methods.  also, the object browser inside visual studio will show you a good deal of explanation on many things.  you can also see a list of methods and properties as well as some very basic info on how to use them with intellisense.  intellisense is the menu that pops up with when you type in the code window.
    Thursday, January 14, 2010 8:04 PM
  • This is sort of a classic error for me; "url"/"Url"/"uRL", however i type it, it shows as an error..
    Friday, January 15, 2010 2:12 PM
  • post the code so we can see why the error occurs.  you may be missing the    e.   before url.  it would look like      e.url      and not url by itself.
    Friday, January 15, 2010 2:32 PM
  • I tried copying what you posted, i tried "e.Url..." i tried "e.url..." i tried everything! Everything you can imagine! And it shows an error, every single time..

    EDIT: here's the error message.

    Error	1	'System.EventArgs' does not contain a definition for 'url' and no extension method 'url' accepting a first argument of type 'System.EventArgs' could be found (are you missing a using directive or an assembly reference?)	

    Friday, January 15, 2010 2:42 PM
  • i forgot this was c#, i have been back and forth in the vb.net and c# forums.

    try this to see some different parts of your url address

            private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
            {
              MessageBox.Show(e.Url.OriginalString);
              MessageBox.Show(e.Url.PathAndQuery);
              MessageBox.Show(e.Url.Query);
            }

    Friday, January 15, 2010 2:57 PM
  • Nothing happens.. :)

    Btw, i figured why that "Url" came as error, it was in a "private void" which included "EventArgs e"
    Friday, January 15, 2010 3:02 PM
  • you need to navigate to a website for the document completed event to fire

    something like this

    private void Form1_Load(object sender, EventArgs e)
            {
              this.webBrowser1.Navigate("url address here");
            }

    Friday, January 15, 2010 3:10 PM
  • Oh, i'm using

    private void button1_Click(object sender, EventArgs e)
    {
    webBrowser1.Url = new System.Uri("http://" + UrlTextBox.Text);
    }
    EDIT: no wait, i think i changed it to .Navigate , or maybe i changed it back again i dont recall.

    EDIT2: It still doesnt work. Here's my code:
           
    public partial class Form1 : Form
        {
            bool http;
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                if (http == false)
                {
                    webBrowser1.Navigate("http://" + UrlTextBox.Text);
                }
                else
                {
                    webBrowser1.Navigate(UrlTextBox.Text);
                }
            }
    
            private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
            {
                MessageBox.Show(e.Url.OriginalString);
                MessageBox.Show(e.Url.PathAndQuery);
                MessageBox.Show(e.Url.Query);
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                this.webBrowser1.Navigate(UrlTextBox.Text);
            }
    
            private void UrlTextBox_TextChanged(object sender, EventArgs e)
            {
                if (UrlTextBox.Text.Contains("http://"))
                {
                    http = true;
                }
                else
                {
                    http = false;
                }
            }
    Friday, January 15, 2010 4:25 PM
  • what part is not working?
    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    Saturday, January 16, 2010 3:02 AM
  •         private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
            {
                MessageBox.Show(e.Url.OriginalString);
                MessageBox.Show(e.Url.PathAndQuery);
                MessageBox.Show(e.Url.Query);
            }
    This part
    Saturday, January 16, 2010 1:07 PM
  • in your code, place a breakpoint next to this line  if (http == false)  by clicking in the gray bar area to the left of the white code window.  this will highlight the line in red.

    now run your project and click the button.  this will hightlght the line in yellow.  press the F11 key to move through each line to watch what happens as each line is executed.  this will help you see what is happening.  as you move past each line, you can hover you mouse over the different object such as http to see the values.
    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    Saturday, January 16, 2010 1:41 PM
  • I've just tried that now, and i set it at "if (http == false)" as you said. When i run it, i can see it handles 
                {
                    webBrowser1.Navigate("http://" + UrlTextBox.Text);
                }
                else
    and then skips the "else" section, since "http" starts out by being false. And then it jumps on to "}" right after the "else" section:
                else
                {
                    webBrowser1.Navigate(UrlTextBox.Text);
                }
            } //this one.
    and then it doesnt handle anything els. The next section is: 
            private void Form1_Load(object sender, EventArgs e)
            {
                this.webBrowser1.Navigate(UrlTextBox.Text);
            }
    but it never handles it. It stops at "}".
    Saturday, January 16, 2010 1:50 PM
  • set a breakpoint at the document completed event declaration (first line) to see if it hits.  i assume it won't since you are not getting any messageboxes but this will get you in the habit of trying to track down issues using breakpoints.

    next thing i might suggest it to completely delete the document completed event, double click the webbrowser control on the form and this should write the event for you.  add the messagebox code to it again.  just the messageboxes, do not paste then entire event code again.

    see what happens then.


    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    • Marked as answer by Harry Zhu Tuesday, January 19, 2010 3:08 AM
    Saturday, January 16, 2010 2:00 PM
  • "set a breakpoint at the document completed event declaration (first line) to see if it hits."
    i tried it before, and it doesnt handle it.

    "track down issues using breakpoints."
    Yeah, it is actually pretty cool - i didnt know it was possible.

    _________________

    It works now :D
    Saturday, January 16, 2010 2:09 PM
  • Alright, now that i have it working :D, i need to find out how to make it allow Form2 to be showed and Form1 to be closed/disposed.

    __________________________
     
    Maybe "hidden" would be fine, if there is a way to close Form1 when Form2 is being closed?

    __________________________

    If i made 2 textboxes, would there then be any way that i could take those textboxes content and autofill my websites Login form with that content?
    Saturday, January 16, 2010 2:20 PM
  • Ok,

    first, glad you got it working

    second, we are going a little bit far in this thread.  not a big deal but the forum prefers to have a single question per thread.

    i will go ahead and address your last questions and then you should start new threads for each specific question you have.  this will help others as well.


    #1
    this is a little bit tricky in c#.net.  vb.net has this setup for you to select from the application properties to handle the shutdown mode based on the first form or last form closing for you.

    so what you need to decide here is do you want to control this and close the first form after you show the second one or do you want to just hide the first form.  hiding is not big deal, you can use   this.hide();  or this.visible = false;  and those will hide the form.

    to close the first form will require some modification to the run command of the form in the program.cs file.

    here is an example to modify the file so that it will not shutdown when you close the very first form that is loaded

    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
    
    namespace test_C_Sharp_app
    {
        static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                //Application.Run(new Form1());
                Form startform = new Form1();
                startform.Show();
                Application.Run();
            }
        }
    }
    

     
    you can see the original line that i commented out whcih will pass the new form1 to the run method.  i added the 3 lines following that to create a new instance of form1, call the show method and run the application without anything passed in.

    now you can show the second form and close the first form without shutting down the application.  the only drawback here is you need call application.exit() from your last for whenever you are ready to close the entire application, otherwise the applicatioin will continue to run even though you close all forms.

    you can handle this in the formclosed event of you second form also by calling application.exit();



    #2
    application.exit(); will close the entire app which would also close form1 if it was hidden.

    #3
    we already discueesed this earlier.  we talked about the webbrowser getelementbyid.   you can do some web and forum searching on that.  i would help you on that one but i am just not ready to get into that this morning.  the weekend, although i still work, tends to be a time my brain doesn't want to go full blast; it needs some down time.



    now keep in mind with the program.cs changes if you go that way, you need just modify it, as you have seen already, sometimes copy and paste does not translate well.

    alright, well this should get you going for today.  do what you can and if you have more questions, start new threads for each question.

    Peace


    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    • Marked as answer by Harry Zhu Tuesday, January 19, 2010 3:08 AM
    Saturday, January 16, 2010 3:23 PM
  • Instead of using LocalHost try using 127.0.0.1.  Moreover, you would be able to connect to local host only if you are running your script on local computer and not any web server.
    Sunday, January 17, 2010 3:13 PM