5
Answers

I would like to know how I can authenticate the username and password for gmail. Please help me out!

Photo of Sean Thu

Sean Thu

13y
4.4k
1
I am making an application that basically let the user log into its gmail account and send email. My user interface will contain username textbox and password textbox, and log in button. If the user type in the correct username and password, it will take the user to another user interface where the user can send email to another gmail user. What I want to know is, on my first user interface, how can I authenticate the username(gmail username) and password that the user type in? I've been looking over the net how to do it. I could not find it unfortunately. Please help me out. Thanks in advance.

Saing

Attachment: sendemail.zip

Answers (5)

1
Photo of PJ Martins
NA 3.8k 27.2k 14y
You'll need to create some type of dictionary that contains the translation of your x,y coordinates to the pixels on the screen, based on this you could find which pixels are selected in your rectangle and see if any of them are contained in your variable to get it's translated x and y coordinates. How is the graph drawn?
Accepted
1
Photo of PJ Martins
NA 3.8k 27.2k 14y

Do you need the two pieces to be gathered into two individual variables? If you simply need a list of points try this:
List<Point> containingPoints = new List<Point>();
for (int i = rect.Left; i <= rect.Left + rect.Width; i++)
{
   for (int j = rect.Top; j <= rect.Top + rect.Height; j++)
   {
      if (points.ContainsKey(new Point(i, j))
         containingPoints.Add(points[new Point(i, j)]);
   }
}
1
Photo of PJ Martins
NA 3.8k 27.2k 14y
You're on the right track, use a Dictionary<Point, Point> where your key is the left (x) and top (y) of your pixel and the second is the x and y point of your graph, then find the corresponding entry just as you described by the that falls within the range. If you're trying to get every point within your rectangle you'd have to loop through each pixel contained inside the rectangle to find it's corresponding graph points (if they exist). Let me know if that guides you on the right direction.
0
Photo of silver lord
NA 5 0 14y

again Hi PJ,

That brings another question and that is how i know that a point (as a key) exists in a rectangular area? 
(sorry about the word outside in the image)
28052010136.jpg


as you see in the picture someone may select a part of graph in way that breaks the graph into 2 parts. i'm completely new to gdi+ so i'm really confused. how can i save a rectangular area and how can i determine if a point is inside that rectangle. can i use this code (rec is selected rectangle) :

foreach( KeyValuePair<Point, Point> kvp in myDictionary )

       if (kvp.Key.Left > rec.Left && kvp.Key.Left < rec.Right  && 
              kvp.Key.Top < rec.Top && kvp.Key.Top > rec.Bottom)

              {

                       kvp.Value is a selected graph (x,y) pair
                }


any notes on this code? and error to be corrected?
Thanks
0
Photo of silver lord
NA 5 0 14y

Hi PJ,
thank you for your help. graph is drawn using zedgraph control available at http://zedgraph.org , so you say i must modify the control so the control returns a dictionary of (key=pixel , value=(x,y)) and when the MouseDown and MouseUp events occur, i must extract the part of dictionary that respond to pixels in MouseDown and MouseUp. can you please give me some advice on tecnical points?
0
Photo of Dushan Stankovic
NA 342 0 14y
You should override OnPaint method if you want to customize control, or set event handler for Paint event for form. In both methods just call:

//it's graphic area of control or form for drawing and painting
Graphics g = e.Graphics;

//Reclagle of drawing area
g.ClipBounds     

//methods for drawing elements
g.DrawLine DrawString DrawRectangle  .......

//methods for filling elements with you Brushes
g.FillRectangle FillElipse .....