<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>大伟的博客 &#187; asp.net</title>
	<atom:link href="http://www.oneflash.net/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oneflash.net</link>
	<description>www.oneflash.net</description>
	<lastBuildDate>Tue, 06 Dec 2011 05:23:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Asp.Net中读取QQWry.Dat进行IP查询的方法</title>
		<link>http://www.oneflash.net/2006/12/ip-query-aspnet/</link>
		<comments>http://www.oneflash.net/2006/12/ip-query-aspnet/#comments</comments>
		<pubDate>Fri, 15 Dec 2006 17:00:00 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Web技术]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://oneflash.net/1970/01/asp-net%e4%b8%ad%e8%af%bb%e5%8f%96qqwry-dat%e8%bf%9b%e8%a1%8cip%e6%9f%a5%e8%af%a2%e7%9a%84%e6%96%b9%e6%b3%95/</guid>
		<description><![CDATA[如何用QQ数据库(QQWry.Dat)制作在线IP查询功能 [开发环境]VS.Net 2003 [编程语言]VB.Net 1.为什么要使用QQWry.Dat做为数据源来开发IP查询功能？ 由于QQWry.Dat数据准确，且时常更新，较为方便。 2.如何读取QQWry.Dat中的数据？ 以Asp.Net为例，详细介绍步骤： a.新建一个web项目。 b.将QQWry.Dat保存到database目录下(可自己更改别的目录) 在Google中查找最新的QQWry.Dat c.将IPLocation.dll下载保存到Bin目录下。如下图： 点击下载IPLocation.dll d.在项目中添加引用，引用IPLocation.dll。 e.在程序代码前添加一行： f.调用函数IPLocate进行IP查询。 完整例子下载：SkyDrive存储]]></description>
			<content:encoded><![CDATA[<p>如何用QQ数据库(QQWry.Dat)制作在线IP查询功能</p>
<p>[开发环境]VS.Net 2003<br />
[编程语言]VB.Net</p>
<p>1.为什么要使用QQWry.Dat做为数据源来开发IP查询功能？<br />
由于QQWry.Dat数据准确，且时常更新，较为方便。</p>
<p>2.如何读取QQWry.Dat中的数据？<br />
以Asp.Net为例，详细介绍步骤：<br />
a.新建一个web项目。<br />
b.将QQWry.Dat保存到database目录下(可自己更改别的目录)<br />
<a target="_blank" href="http://www.google.com/search?hl=zh-CN&amp;newwindow=1&amp;q=IP%E6%95%B0%E6%8D%AE+QQWry&amp;btnG=%E6%90%9C%E7%B4%A2&amp;lr=">在Google中查找最新的QQWry.Dat</a><br />
c.将IPLocation.dll下载保存到Bin目录下。如下图：<br />
<a href="http://www.oneflash.net/attachments/month_0612/g200612161210.rar" target="_blank">点击下载IPLocation.dll</a><br />
<img src="/attachments/month_0612/m2006121604738.gif" border="0" alt=""/><br />
d.在项目中添加引用，引用IPLocation.dll。<br />
e.在程序代码前添加一行：</p>
<pre class="brush: vb; title: ; notranslate">
Imports IPLocation.IPLocation
</pre>
<p>f.调用函数IPLocate进行IP查询。</p>
<pre class="brush: vb; title: ; notranslate">
IPLocate(Byval StrConn as string,Byval StrIp as string)
'StrConn 为数据库连接字符串，如：Server.MapPath(&quot;database/QQWry.Dat&quot;)
'StrIP      为查询IP
</pre>
<p>完整例子下载：<a target="_blank" href="http://cid-7e5be87297a72d8f.skydrive.live.com/self.aspx/Public/GetIp.rar">SkyDrive存储</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneflash.net/2006/12/ip-query-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asp.Net中对Cookie的基本操作</title>
		<link>http://www.oneflash.net/2006/12/aspnet-cookie/</link>
		<comments>http://www.oneflash.net/2006/12/aspnet-cookie/#comments</comments>
		<pubDate>Thu, 14 Dec 2006 16:37:00 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Web技术]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[cookie]]></category>

		<guid isPermaLink="false">http://oneflash.net/1970/01/asp-net%e4%b8%ad%e5%af%b9cookie%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c/</guid>
		<description><![CDATA[语言：vb]]></description>
			<content:encoded><![CDATA[<p>语言：vb</p>
<pre class="brush: vb; title: ; notranslate">Imports System.Web.HttpContext
Public Class CookieFramework
    '写入单个Cookie
    Public Shared Function WriteCookie(ByVal CookieName As String, ByVal CookieValue As String, ByVal ExpiresDate As Integer) As Boolean
        Dim aCookie As New HttpCookie(CookieName)
        aCookie.Value = CookieValue
        aCookie.Expires = DateTime.Now.AddDays(ExpiresDate)
        System.Web.HttpContext.Current.Response.Cookies.Add(aCookie)
    End Function

    '给Cookie集合添加子项
    Public Shared Function WriteCookies(ByVal CookieName As String, ByVal CookieItem As String, ByVal ItemValue As String, ByVal ExpiresDate As Integer) As Boolean
        Dim aCookie As HttpCookie
        If Current.Request.Cookies(CookieName) Is Nothing Then
            aCookie = New HttpCookie(CookieName)
        Else
            aCookie = Current.Request.Cookies(CookieName)
        End If
        aCookie.Values(CookieItem) = ItemValue
        aCookie.Expires = DateTime.Now.AddDays(ExpiresDate)
        System.Web.HttpContext.Current.Response.Cookies.Add(aCookie)
    End Function
    '读取单个Cookie
    Public Shared Function ReadCookie(ByVal CookieName As String) As String
        If Current.Request.Cookies(CookieName) Is Nothing Then
            Return Nothing
        Else
            Return Current.Request.Cookies(CookieName).Value
        End If
    End Function

    '读取Cookie集合中的子项内容
    Public Shared Function ReadCookies(ByVal CookieName As String, ByVal CookieItem As String) As String
        If Current.Request.Cookies(CookieName) Is Nothing Then
            Return Nothing
        Else
            If Current.Request.Cookies(CookieName).Values(CookieItem) Is Nothing Then
                Return Nothing
            Else
                Return Current.Request.Cookies(CookieName).Values(CookieItem)
            End If
        End If
    End Function
    '删除整个Cookie
    Public Shared Function DeleteCookie(ByVal CookieName As String) As Boolean
        Dim aCookie As New HttpCookie(CookieName)
        Dim i As Integer
        Dim limit As Integer = Current.Request.Cookies.Count - 1
        For i = 0 To limit
            aCookie = Current.Request.Cookies(i)
            aCookie.Expires = DateTime.Now.AddDays(-1)
            Current.Response.Cookies.Add(aCookie)
        Next
    End Function
    '删除Cookie集合中的子项
    Public Shared Function DeleteCookies(ByVal CookieName As String, ByVal ItemName As String) As Boolean
        Dim aCookie As HttpCookie = Current.Request.Cookies(CookieName)
        aCookie.Values.Remove(ItemName)
        aCookie.Expires = DateTime.Now.AddDays(1)
        Current.Response.Cookies.Add(aCookie)
    End Function
End Class
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.oneflash.net/2006/12/aspnet-cookie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

