05 2013 档案

用于正则表达式的 Regex.Matches静态方法的几种用法 转载
摘要://①正则表达式 = > 匹配字符串 string Text = @"This is a book , this is my book , Is not IIS"; //定义一个模式字符串,不仅仅是纯文本,还可以是正则表达式 string Pattern = "is"; MatchCollection Matches = Regex.Matches( Text, Pattern, RegexOp... 阅读全文

posted @ 2013-05-27 16:13 seaven 阅读(478) 评论(0) 推荐(0)

C#中将dll汇入exe,并加壳(转载)
摘要:这几天在做自己的一个小程序,因为使用了3层架构,运行目录下有很多dll文件,最终发布时,我打算将dll文件都合并到exe文件中去。微软发布的免费软件ILmerge可以完成这项工作,研究了一下,其用法如下:1、合并file1.dll、file2.dll到destination.dllILmerge /ndebug /target:dll /out:C:\destination.dll /log C:\file1.dll C:\file2.dll2、合并file1.dll、file2.dll以及myApp.exe到newApp.exeILmerge /ndebug /target:winexe / 阅读全文

posted @ 2013-05-25 15:10 seaven 阅读(1424) 评论(0) 推荐(1)

用wininet库模拟cookie方式验证码登录
摘要:#include "stdafx.h"#include <windows.h>#include <wininet.h>#include <tchar.h>#include <conio.h>#include <time.h>DWORD WriteDataToFile(LPSTR lpFileName, LPSTR data, int size){ DWORD dwWritten; HANDLE hFile = CreateFileA(lpFileName, GENERIC_WRITE, 0, NULL, CREAT 阅读全文

posted @ 2013-05-13 20:54 seaven 阅读(2241) 评论(0) 推荐(0)

wininet.dll函数库:不会过期的cookie
摘要:using System;using System.Text;using System.Runtime.InteropServices;namespace seaven{ class Program { /// <summary> /// 设置cookie /// </summary> [DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true)] public static extern bool InternetSetCookie... 阅读全文

posted @ 2013-05-09 23:18 seaven 阅读(391) 评论(0) 推荐(0)

Python采集网页数据保存到excel
摘要:urllib读取网页,然后用Py-excel写excel。import urllibfrom xlwt import Workbookimport datetimedef FetchData(): book = Workbook(encoding='gbk') #如果采集数据有中文,需要添加这个 sheet1 = book.add_sheet('Sheet 2') #表格缓存 i = 0 theday = datetime.date(2009,12,31) while i < 100: #这边的场景就是采集100个网页,每个网址都包含日期 ... 阅读全文

posted @ 2013-05-05 17:35 seaven 阅读(8480) 评论(0) 推荐(0)

使用Python抓取网页图片[转载]
摘要:ImgDownloaderimport win32com.client,time,win32inet,win32file,osclass ImgDownloader: def __init__(self,url,dir): self.__dir=dir self.__ie=win32com.client.Dispatch('InternetExplorer.Application') self.__ie.Navigate(url) self.__wait__() def __wait__(self): while... 阅读全文

posted @ 2013-05-03 09:14 seaven 阅读(525) 评论(0) 推荐(0)

导航