Jump to content

Photo

Mono for android vs C#


  • Please log in to reply
5 replies to this topic

#1 Delta22

Delta22

    Kilobyte

  • Members
  • 139 posts
  • LocationAustralia

Posted 16 April 2013 - 12:47 AM

I recently designed a c# program that automatically logs into a website with my credentials, and then collects the data, and then i downloaded mono for android but my code isnt working in it,i thought it would close? any thoughts on that?

 

well we're on this topic, how do i play around with html elements in mono for android, C# is something like GetElementById and so forth but not in mono for android?  


Programmer(in training), hacker(in minimal training), good with computers and mature, all you need to know about me but feel free to talk to me, contact me or whatever, i am no danger.


#2 Guest_ElatedOwl_*

Guest_ElatedOwl_*
  • Guests

Posted 16 April 2013 - 07:26 AM

You compiled it with mono and not visual studio, right?



#3 Delta22

Delta22

    Kilobyte

  • Members
  • 139 posts
  • LocationAustralia

Posted 16 April 2013 - 08:26 AM

You compiled it with mono and not visual studio, right?

I installed mono, and created a mono project, then copied my code but i cant get most of the things to work such as getelementbyid, considering im completely new to mono, so i compiled it in mono in visual studio.


Programmer(in training), hacker(in minimal training), good with computers and mature, all you need to know about me but feel free to talk to me, contact me or whatever, i am no danger.


#4 Delta22

Delta22

    Kilobyte

  • Members
  • 139 posts
  • LocationAustralia

Posted 16 April 2013 - 09:06 PM

I want this in mono but all the code is different, i know almost nothing about mono. < all i know is the c# part(by precise code)

^i just want to make an app out of it

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.IO;
using System.Text;
using System.Windows.Forms;
 
namespace Bigpond
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        WebBrowser wb = new WebBrowser();
        private void Form1_Load(object sender, EventArgs e)
        {
            wb.Navigate("https://www.my.telst.../myaccount/home");
            wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted);
        }
 
        void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
 
            if (wb.ReadyState == WebBrowserReadyState.Complete)
            {
 
                HtmlElementCollection classButton = wb.Document.All;
                foreach (HtmlElement element in classButton)
                {
                    if (element.GetAttribute("className") == "btn-blue")
                    {
                        wb.Document.GetElementById("username").InnerText = "My_username"; //the textbox i insert my username
                        wb.Document.GetElementById("password").InnerText = "My_password"; //the textbox i insert my password
                        wb.Document.InvokeScript("submitLoginForm");
 
                        break;
                    }
                    if (element.GetAttribute("className") == "with-only-usage")
                    {
                        element.InvokeMember("click");
                    }
                    if (element.GetAttribute("className") == "inner")
                    {
                        element.InvokeMember("click");
                    }
 
                    if (element.GetAttribute("className") == "usage-detail-container usage-so-far")
                    {
                        label1.Text = ("Cap: ") + element.InnerText;
                        //break;
                    }
                    if (element.GetAttribute("className") == "usage-detail-container remains")
                    {
                        label2.Text = ("Remaining: ") + element.InnerText;
                        //break;
                    }
                    if (element.GetAttribute("className") == "usage-detail-container days-remaining")
                    {
                        label3.Text = ("Days: ") + element.InnerText;
                        break;
                    }
                }
 
 
 
            }
 
 
        }
 
        private void label1_Click(object sender, EventArgs e)
        {
 
        }
    }
}

Programmer(in training), hacker(in minimal training), good with computers and mature, all you need to know about me but feel free to talk to me, contact me or whatever, i am no danger.


#5 Champion of Cyrodiil

Champion of Cyrodiil

    Gigabyte

  • Members
  • 776 posts
  • LocationVirginia

Posted 29 April 2013 - 02:04 PM

What is the purpose behind trying to connect to a wireless network via custom c# interface?  If you want this on android, use the Android SDK.  If using windows, you will want the wireless zero config API which is now 'Native Wifi' API



#6 Delta22

Delta22

    Kilobyte

  • Members
  • 139 posts
  • LocationAustralia

Posted 30 April 2013 - 02:53 AM

What is the purpose behind trying to connect to a wireless network via custom c# interface?  If you want this on android, use the Android SDK.  If using windows, you will want the wireless zero config API which is now 'Native Wifi' API

 

Everytime i want to see my cap usage for my internet or NF notification or any website i have to log into first, i have to go to the website and log in(which is a pain to me), now the code above works(i just removed my details), it works perfectly but only on windows, i want it on android, this program is designed to log into my account and fetch the details or show the website(when already logged in). which spares me time and pain. 


Programmer(in training), hacker(in minimal training), good with computers and mature, all you need to know about me but feel free to talk to me, contact me or whatever, i am no danger.