using System; using System.IO; using System.Security.Cryptography; using System.Text; namespace ClassLibrary1 { class Code { //1.base64 to string public static string Base64Encrypt(string strPath) { byte[] bpath = Convert.FromBase64String(strPath); s
using System; using System.IO; using System.Security.Cryptography; using System.Text; //加密字符串,注意strEncrKey的长度为8位(如果要增加或者减少key长度,调整IV的长度就是了) //public string DesEncrypt(string strText, string strEncrKey) //解密字符串,注意strEncrKey的长度为8位(如果要增加或者减少key长度,调整IV的长
自己写爬虫时买的代理ip有密码,在网上查了都是下面这种: 1.在Scrapy工程下新建"middlewares.py": import base64 # Start your middleware class class ProxyMiddleware(object): # overwrite process request def process_request(self, request, spider): # Set the location of the proxy reque