Archive for 十月, 2009
.net C#获得网页完整代码函数.. WebRequest方式的…前面有webclient方式的~
星期四, 十月 29th, 2009
webclient 的延时并不好, 所以后来使用的是 WebRequest方式获得代码~
using System.Net;
using System.Text.RegularExpressions;
using System.Web;
using System.IO;
private string getHtml(string url)
{
HttpWebRequest myRequest;
HttpWebResponse myResp = null;
[...]
.net读取mssql基础语句– 使用web.config保存数据库字符串
星期一, 十月 26th, 2009
web.config 中 加入
Connect Timeout=300 是连接超时时间!
程序中读取:
using System.Configuration;
using System.Data.SqlClient;
SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["datastr"]);
SqlCommand cmd = new SqlCommand(“sql语句”, con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
[...]
提交获得到的cookie来获取需要登录的网页代码~
星期一, 十月 12th, 2009
using System.Net;
private string getHtml(string url)
{
WebClient myWebClient = new WebClient();
myWebClient.Headers.Add(“Cookie”, “cookie内容″);
[...]
c#使用ftp上传多线程技术实现 progressBar显示不卡死代码
星期六, 十月 10th, 2009
using System.Net;
using System.IO;
using System.Threading;
记得添加他们~
public string doc, fname, tname;
private FtpStatusCode UploadFun(string fileName, string uploadUrl)
{
Stream requestStream = null;
FileStream fileStream = null;
[...]
