Could you please post more details information about auto put value in that text box in page and auto click on blue bottun to search value and return me result?
Do you mean if I click the support button, then it will auto type in the 1 value into the textbox? What you mean about the bot?
Best Regards,
Brando
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
i need write code than login automaticly to dashboard
this picture is dashboard page after i logged in manually
in this page i put that number on textbox like picture ( number 1 ) and when i pressed Enter bottom it show me below picture
in this page i pressed on help icon (number 3 ) then it show me that details (number 4)
this is manually
now my problem is than i need do this work programmatically from another project to get that details (number4)
my auto login code is like below but i dont know how i can do another steps (put number then press enter bottom then click on help icon then get that details)
Uri uri1 = new Uri("http://crm.sibesabzadsl.ir/index.php/main/login");
string strPostData = String.Format("Username={0}&Password={1}", "h_net2020.ir", "******");
HttpWebRequest webreq1 = WebRequest.Create(uri1) as HttpWebRequest;
webreq1.Method = "post";
webreq1.ContentLength = strPostData.Length;
webreq1.ContentType = "application/x-www-form-urlencoded";
CookieContainer cookieContainer = new CookieContainer();
webreq1.CookieContainer = cookieContainer;
StreamWriter web1_p = new StreamWriter(webreq1.GetRequestStream());
web1_p.Write(strPostData);
web1_p.Close();
HttpWebResponse Hr_resp = (HttpWebResponse)webreq1.GetResponse();
StreamReader sr_reader = new StreamReader(Hr_resp.GetResponseStream());
string weba = sr_reader.ReadToEnd();
Label1.Text = weba.ToString();
sr_reader.Close();
Sorry for this late reply and thanks for the updated description, the requirement is clear now.
The point to convert from manually to automatically is, fire your functions(including search function in your second image, help button in your third image) automatically.
There are two suggestions i can provide.
Use HttpRequest.QueryString in your page load event, check if there's parameter in your request url, call related functions if there is. For
example, add your expected textbox's value as the parameter:
http://xxxx.xxx?search={the value you should manually put in the textbox}, check if the Request.QueryString["search"] is null, call search funtion if it's not null.
Add
webapi to your app and let that api call the functions.
Member
303 Points
255 Posts
how to create bot in asp.net for login to another website and get some results in c#
Mar 31, 2020 11:15 AM|uniservice3|LINK
hi guys
i need to create bot for login to another url and get some request in that page in c#
this is my login bot code
when this code run it show me logged in page
like below:
in this page i need open this link
http://crm.sibesabzadsl.ir/index.php/main/support
in this page i need my page auto put value in that text box in page and auto click on blue bottun to search value and return me result
of course it must then auto click on number 1 and then show me number 2 content like this picture
how i can create this bot?
Star
9831 Points
3120 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 02, 2020 12:49 AM|Brando ZWZ|LINK
Hi uniservice3,
Could you please post more details information about auto put value in that text box in page and auto click on blue bottun to search value and return me result?
Do you mean if I click the support button, then it will auto type in the 1 value into the textbox? What you mean about the bot?
Best Regards,
Brando
Member
303 Points
255 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 02, 2020 09:27 AM|uniservice3|LINK
ty brando
my english is not well
can i have your skype id?
Contributor
3140 Points
983 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 03, 2020 01:30 AM|Yang Shen|LINK
Hi uniservice3,
Seems your images are all 404, can you update them along with the description?
When you say "auto", you mean programmatically right? I think this is feasible as long as we get more detailed information about the requirement.
ps: We don't provide skype support, thanks for cooperation.
Best Regard,
Yang Shen
Member
303 Points
255 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 03, 2020 07:55 AM|uniservice3|LINK
hi again
ty yang shen
look this picture
this is login page
i need write code than login automaticly to dashboard
this picture is dashboard page after i logged in manually
in this page i put that number on textbox like picture ( number 1 ) and when i pressed Enter bottom it show me below picture
in this page i pressed on help icon (number 3 ) then it show me that details (number 4)
this is manually
now my problem is than i need do this work programmatically from another project to get that details (number4)
my auto login code is like below but i dont know how i can do another steps (put number then press enter bottom then click on help icon then get that details)
Contributor
3140 Points
983 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 06, 2020 01:51 AM|Yang Shen|LINK
Hi uniservice3,
Sorry for this late reply and thanks for the updated description, the requirement is clear now.
The point to convert from manually to automatically is, fire your functions(including search function in your second image, help button in your third image) automatically.
There are two suggestions i can provide.
Best Regard,
Yang Shen
Member
303 Points
255 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 06, 2020 02:38 PM|uniservice3|LINK
ty yang shen
this is support search form code and post link (second image)
and this is help bottun functions in third image
html code
java script functions
Contributor
3140 Points
983 Posts
Re: how to create bot in asp.net for login to another website and get some results in c#
Apr 07, 2020 02:27 AM|Yang Shen|LINK
Hi uniservice3,
There's another way to create this auto bot to click and input values for specific elements in your web page - the webdriver selenium c#.
Notice that in the webdriver Webelement Commands, you can use Click command to click specific elements and use SendKeys command to input values.
Go through this tutorial and you shall be able to implement the auto process.
Best Regard,
Yang Shen