This article is a mirror article of machine translation, please click here to jump to the original article.

View: 22965|Reply: 6

[New Issue] WPF logs in to Discuz and posts

[Copy link]
Posted on 5/28/2019 2:02:28 PM | | | |
I wrote a wpf form to implement discuz forum login and posting functions,
Login is implemented. Collecting other websites is also realized, and the collected content is converted from html to ubb as the content of the post.
What I don't understand now is that the login is implemented in a WPF form and this login state remains logged in during the post button action,
Whether his cookie and formhash values remain the same throughout the click process in WPF.
I have been with two errors;
1. "Sorry, your request is from the wrong source or the form verification string does not match and cannot be submitted";
2. "Your current access request contains illegal characters and has been rejected by the system";
whether it is a question of cookies and formhash;
Or is it a matter of coding;
Or do you want to introduce a browser plugin into a WPF form?





Previous:wpf implements the PictureBox control in winform
Next:. Net integration PayPal IPN return value has always been INVALID
Posted on 5/28/2019 2:45:55 PM |
Cookies are certainly constant, but formhash changes every time
 Landlord| Posted on 5/28/2019 2:51:53 PM |
Xiao Zhazha Posted on 2019-5-28 14:45
Cookies are certainly constant, but formhash changes every time

Is it different when logging in and posting?
Posted on 5/28/2019 2:59:36 PM |
Summer Posted on 2019-5-28 14:51
Is it different when logging in and posting?

I found that the formhash does not need to change every time, which may be different from logging in
Tested it:



Post normally.

URL address:https://www.itsvse.com/forum.php ... ra=&topicsubmit=yes
where the FID is the ID of the plate

post request, request content:
formhash=835c223b&posttime=1559026000&wysiwyg=1&typeid=1&subject=test&message=by%EF%BC%9Aitsvse. com%0D%0A&replycredit_extcredits=0&replycredit_times=1&replycredit_membertimes=1&replycredit_random=100&readperm=&price=&tags=&rushreplyfrom=&rushreplyto=&rewardfloor=& replylimit=&stopfloor=&creditlimit=&allownoticeauthor=1&addfeed=1&usesig=1&save=&adddynamic=true


After a successful post, the serverReturns a 301 status code, and return the post address.


Posted on 5/28/2019 3:04:47 PM |
I tested it with postman and it can post normally, as shown below:


Postman will automatically attach the current browser's cookie, so you don't need to configure cookies.


 Landlord| Posted on 5/28/2019 3:07:41 PM |
Xiao Zhazha Posted on 2019-5-28 15:04
I tested it with postman and it can post normally, as shown below:

Your post requested
formhash=835c223b is at login time
Posted on 5/28/2019 3:09:32 PM |
Summer Posted on 2019-5-28 15:07
Your post requested
formhash=835c223b is at login time



It should be, every user's is different
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com