Example #1
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     voiceConnection = new Voice(loginEmail.Text, loginPass.Text);
     voiceConnection.login();
     callGroup.Enabled = true;
     smsGroup.Enabled = true;
 }
Example #2
0
        static void Main()
        {
            /*
            // Give me your username
            Console.WriteLine("Enter Your Google Voice Username, eg [email protected]:");
            String userName = null;
            try {

                userName = Console.ReadLine();
            } catch {
                Console.WriteLine("IO error trying to read your name!");
                return;
            }

            // And your password
            Console.WriteLine("Enter Your Password:"******"IO error trying to read your name!");
                 return;
            }

            // I honestly don't have a clue what this if for...
            // it was in the java code, so I left it but I don't think it's used for anything.
            Console.WriteLine("Enter A \"Source\" for the Log:");
            String source = null;
            try {
                source = Console.ReadLine();
            } catch {
                 Console.WriteLine("IO error trying to read your name!");
                 return;
            }

            // the really long string you have to get from the google voice site source.
            Console.WriteLine("Log into Google Voice and find the _rnr_se variable in the page Source. ");
            Console.WriteLine("Enter rnr_se_ value:");
            String rnrSee = null;
            try {
                rnrSee = Console.ReadLine();
            } catch {
                 Console.WriteLine("IO error trying to read your name!");
                 return;
            }
            */
            try {
                string email = "*****@*****.**";
                Console.Write("Login for "+email+"; password: "******"7175216367", "5705036367");

                voice.logout();

                /*
                try {

                    XmlDocument test = new XmlDocument();
                    try
                    {
                        test.Load("sms.log");

                        XmlNodeList list = test.ChildNodes;
                        list = list[1].ChildNodes;
                        //list = list[0].ChildNodes;

                        //XPath xpath = XPathFactory.newInstance().newXPath();
                        XPathDocument doc = new XPathDocument("inbox.log");
                        //InputSource isource = new InputSource(method.getResponseBodyAsStream());
                        XPathNavigator nav = doc.CreateNavigator();
                        nav.MoveToRoot();
                        XPathNodeIterator NodeIter;
                        NodeIter = nav.Select("/response/json");
                        while (NodeIter.MoveNext())
                        {
                            Console.WriteLine("test: {0}", NodeIter.Current.Value);
                        };
                        //out = xpath.evaluate("/response/json", isource);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message);
                    }
                    /*
                    // This code is for sending text messages...
                    Console.Write("Number: ");
                    string number = Console.ReadLine();
                    Console.Write("Message: ");
                    string msg = Console.ReadLine();

                    MessageBox.Show( voice.sendSMS(number, msg));
                    */

                    /*
                    // This code is for getting the XML data from google about
                    // information in your inboxes.
                    // Parse it yourself, I'm too lazy to do it.

                    File.WriteAllText("inbox.log", voice.getInbox());
                    Thread.Sleep(2000);

                    File.WriteAllText("missed.log",voice.getMissed());
                    Thread.Sleep(2000);

                    File.WriteAllText("placed.log",voice.getPlaced());
                    Thread.Sleep(2000);

                    File.WriteAllText("received.log",voice.getReceived());
                    Thread.Sleep(2000);

                    File.WriteAllText("recent.log",voice.getRecent());
                    Thread.Sleep(2000);

                    File.WriteAllText("recorded.log",voice.getRecorded());
                    Thread.Sleep(2000);

                    File.WriteAllText("sms.log",voice.getSMS());
                    Thread.Sleep(2000);

                    File.WriteAllText("spam.log",voice.getSpam());
                    Thread.Sleep(2000);

                    File.WriteAllText("starred.log",voice.getStarred());
                    Thread.Sleep(2000);

                    Console.ReadLine();
                } catch( Exception e) {
                    Debug.WriteLine(e.StackTrace);
                    MessageBox.Show(e.Message);//Debug help
                }*/
            } catch (IOException e) {
                Debug.WriteLine(e.StackTrace);
                MessageBox.Show(e.Message);//more Debug help
            }
        }