What I am trying to is automatic bidding process in Ebay site...
WebClient class can uploads form data easily.
I have collected ebay url & form data to uploads..
Most of process is quite easy and simple. But ebay webserver send me your password is not valid...
But the password is clearly correct.. you can type it at the result page and submit. Then you can see a message - bidding has ended and you are logged in. <- This is the message I want.
I can not find where is a wrong part. Some code is worng?? Or whole different way..? Please help me~~~~
here is the code------------------------------------------------------------
WebForm1.aspx--------------------------------------------------
<%@ Page language="c#" Codebehind="Web Form1.aspx.cs" AutoEventWireup ="false" Inherits="WebCl ient.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1 </title>
<meta name="GENERATOR " Content="Micros oft Visual Studio 7.0">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema" content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 200px; POSITION: absolute; TOP: 32px" runat="server" Text="Button"></asp:Button>
</form>
</body>
</HTML>
WebForm1.aspx.c s--------------------------------------------------
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Text.Reg ularExpressions ;
using System.IO;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Net;
using System.Collecti ons.Specialized ;
namespace WebClient
{
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
//
InitializeCompo nent();
base.OnInit(e);
}
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
}
#endregion
private void Button1_Click(o bject sender, System.EventArg s e)
{
try
{
// Download the data to a buffer.
System.Net.WebC lient client = new System.Net.WebC lient();
//client.
Byte[] pageData = client.Download Data("http://signin.ebay.com/ws1/eBayISAPI.dll?M fcISAPICommand= MakeBid&item=57 03948646&co_par tnerid=&quantit y=1&maxbid=335& placebid=Bid+Ag ain+%3E.");
WebHeaderCollec tion myWebHeaderColl ection = client.Response Headers;
for (int i=0; i < myWebHeaderColl ection.Count; i++)
{
Response.Write( myWebHeaderColl ection.GetKey(i ) +":"+ myWebHeaderColl ection.Get(i)+" <br>");
}
// Upload some form post values.
NameValueCollec tion form = new NameValueCollec tion();
Response.Write( "-------------------------------------------------<br>");
// Add form data
form.Add("MfcIS APICommand", "MakeBid");
form.Add("item" ,"5703948646 ");
form.Add("maxbi d","US $335.00");
form.Add("quant ","1");
form.Add("useri d","");
form.Add("key", "$2$13400446$NI vqcQYD7KdSclr65 dbJk0");
form.Add("javas criptenabled"," 1");
form.Add("mode" ,"1");
form.Add("user" ,"kmmccc");
form.Add("pass" ,"rlaaudcks" );
Byte[] responseData = client.UploadVa lues("http://offer.ebay.com/ws/eBayISAPI.dll", form);
Response.Write( Encoding.ASCII. GetString(respo nseData));
}
catch (WebException webEx)
{
Response.Write( webEx.ToString( ));
}
}
}
}
-------------------------------------------------------------------------------------
--------------------------------
From: mc kim in Korea
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>w+P3QVPH60K JT1gi6OG97g==</Id>