问题描述
求教一下啊http://nb.163.com/cgi-bin/vipbar/showimage.py?rand_num=0.2117899715202149怎么获取这个rand_num
解决方案
解决方案二:
理论上说轻易获取不了,当然这是相当不轻易。因为理论上说Python产生的是伪随机数序列,既然是这样,就可以获取这个序列,当然,这是理论而以,现代的伪随机数算法配合使用环境,已经可以在工程上当作真正的随机数使用了。既然是随机数,如果你能预测,那么你可以去买彩票了。因为彩票就是人类试图预测随机数的一个生动案例。
解决方案三:
温州-星星(42095900)11:16:33publicstaticCookieContainermyCookieContainer;privatevoidbgetcode_Click(objectsender,EventArgse){HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create("http://nb.163.com/cgi-bin/vipbar/showimage.py?");request.CookieContainer=myCookieContainer;HttpWebResponseresponse=(HttpWebResponse)request.GetResponse();response.Cookies=myCookieContainer.GetCookies(request.RequestUri);//获取一个包含url的Cookie集合的CookieCollectionStreamresponseStream=response.GetResponseStream();//StreamresponseStream=((HttpWebResponse)request.GetResponse()).GetResponseStream();Imageoriginal=Image.FromStream(responseStream);BitmapbitMap=newBitmap(original);this.pictureBox1.Image=bitMap;//注意:替换为你的PictureBox控件名字responseStream.Close();}privatevoidtopost(){stringcode=tbyzm.Text.ToString();ArrayListlist1=newArrayList();CookieContainercookie=newCookieContainer();stringpostdate="act=userlogin&urs=stst65432@163.com&password=stst123456&authcode="+code;stringposturl="http://nb.163.com/cgi-bin/vipbar/login.py";//list1=PostData(postData,postUrl,cookie);ASCIIEncodingencoding=newASCIIEncoding();byte[]data=encoding.GetBytes(postdate);HttpWebRequestmyrequeat=(HttpWebRequest)WebRequest.Create(posturl);myrequeat.CookieContainer=myCookieContainer;myrequeat.Method="POST";myrequeat.ContentType="application/x-www-form-urlencoded";myrequeat.ContentLength=data.Length;myrequeat.Accept="image/gif,image/jpeg,image/pjpeg,image/pjpeg,application/x-ms-application,application/x-ms-xbap,application/vnd.ms-xpsdocument,application/xaml+xml,*/*";StreamnewStream=myrequeat.GetRequestStream();//Sendthedata.newStream.Write(data,0,data.Length);//写入参数newStream.Close();HttpWebResponseresponse2=(HttpWebResponse)myrequeat.GetResponse();response2.Cookies=myCookieContainer.GetCookies(myrequeat.RequestUri);StreamReadersr2=newStreamReader(response2.GetResponseStream(),Encoding.UTF8);recievedate=sr2.ReadToEnd();textBox1.Text=recievedate;这样有什么问题的吗?