WP-PostRatings 修改*
wp-postratings.php 改变。
AJAX Comment Pager
WP-CommentNavi
WP-EasyArchives
WP-PageNavi
WP-RecentComments
Andy
Andy
none
C#连接Oracle数据库的字符串如下:
Data Source=GDBZH;User Id=zhangf;Password=guangy;
需要特别指出的是Data Source这个值是什么,从哪里获取到(后面两个,能在这里看到的,估计都知道意思了吧,后面两个不解析了)。
Data Source:从字面上解释就是数据源,这个数据源是从Oracle的tnsnames.ora文件中去找的。而并非是在系统的“管理工具”下的“数据源(ODBC)”中找。这个tnsnames.ora文件是在Oracle的安装目录下的“network\admin\”下。如我这个例子的GDBZH是这样的:
GDBZH = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = GDBZH) ) )
这里说明一下:SERVICE_NAME = GDBZH 这个应该是Oracle是数据库的名称。在安装时如果没改的话,一般默认是ORCL。
令人怀念的故事。
(一)小象要回家
1.小蝌蚪找妈妈2.大萝卜3.小萝卜4.小猴摘桃5.镜子里的小花猫6.老虎外婆7.鸭妈妈找蛋8.金色的房子9.老鼠嫁女10.小象要回家
(二)丑小鸭
1.丑小鸭2.年画上的牧童3.金斧头4.不怕冷的大衣5.爱吹牛的小花狗6.杜鹃鸟7.聪明的乌龟8.大公鸡和漏嘴巴9.猴子挠月亮10.十二生肖的故事
(三)小红帽
1.小红帽2.渔夫和金鱼3.狼来了4.渔夫和金鱼5.卖火柴的小女孩6.皇帝的新衣
(四)九色鹿
1.牛郎织女2.长发妹3.哪吒闹海4.九色鹿5.三个和尚6.后羿射日7.嫦娥奔月
(五)小猫钓鱼
1.小猫钓鱼2.小马过河3.三只羊4.雪花5.逞强的青蛙6.看星星的孩子7.曹冲称象8.孔融让犁9.文彦博树洞取球10.司马光破缸救人11.象和猴子12.青蛙飞天13.神鸟
利用Google Directions API (Google Map) http://code.google.com/intl/zh-CN/apis/maps/documentation/directions/
和VB.net 输入目的地(支持中文地址、经纬度等)计算出距离。
如:输入 北京|上海|天津
运行程序 会计算从A地出发依次到北京、上海、天津 三地的总距离,可选择是否包含返回的距离(天津到A地的距离)。
如果需要线路优化 可以参照API 介绍中的 optimize:true。开启后会自动安排路线。
已经在VB.net 2003 通过测试。
做的着急有些地方直接复制的,代码没有优化,有些重复,但不影响最终使用。
'需要以下命名空间 Imports System.web Imports System.Xml Imports System.IO '需要声明的变量 Dim gstrPatch As String = "C:\XXX\map.xml" Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click '判断输入的目的地是否为空。 If txtROAD_ROUTE.Text = "" Then Exit Sub Try If MsgBox("路程距离数据会受到网络、关键字的影响,可能与实际距离相差很大,仅供参考。", MsgBoxStyle.YesNo, "系统提示") = MsgBoxResult.No Then Exit Sub Dim arrROAD As String() Dim strWaypoints As String Dim i As Integer = 0 arrROAD = txtROAD_ROUTE.Text.Split("|") Dim arrCalc(arrROAD.Length - 1) As String '对搜索的目的地编码 For t As Integer = 0 To arrROAD.Length - 1 arrROAD(t) = HttpUtility.UrlEncode(arrROAD(t), System.Text.Encoding.UTF8) Next '编码重组 For t As Integer = 0 To arrROAD.Length - 2 If strWaypoints = "" Then strWaypoints = arrROAD(t) Else strWaypoints = strWaypoints & "|" & arrROAD(t) End If Next '39.049435,121.782503 为出发地 经纬度,可以替换成路名、地名等,注意中文请注意转码。 Dim strURL As String strURL = "<a href="http://maps.google.com/maps/api/directions/xml?origin=39.049435,121.782503&destination">http://maps.google.com/maps/api/directions/xml?origin=39.049435,121.782503&destination</a>=" & arrROAD(arrROAD.Length - 1) & _ "&waypoints=" & strWaypoints & _ "&sensor=false" Dim myWebClient As New System.Net.WebClient 'myWebClient.DownloadFile("<a href="http://maps.google.com/maps/api/directions/xml?origin=39.049435,121.782503&destination">http://maps.google.com/maps/api/directions/xml?origin=39.049435,121.782503&destination</a>=" & strdifang & "&waypoints=&sensor=false", "C:\msdn.xml") myWebClient.DownloadFile(strURL, gstrPatch) Dim xmlDoc As New XmlDocument Dim XmlFileName As String = gstrPatch If File.Exists(XmlFileName) Then xmlDoc.Load(XmlFileName) Dim nodeList As XmlNodeList = xmlDoc.SelectSingleNode("DirectionsResponse").ChildNodes Dim xn1 As XmlNode Dim xn2 As XmlNode Dim xn3 As XmlNode For Each xn1 In nodeList For Each xn2 In xn1 For Each xn3 In xn2 If xn3.Name = "distance" Then arrCalc(i) = xn3.ChildNodes.Item(1).InnerText i = i + 1 End If Next Next Next End If Dim douKM As Double Dim strLast As String If MsgBox("是否计算往返路程?", MsgBoxStyle.YesNo, "系统提示") = MsgBoxResult.Yes Then strURL = "<a href="http://maps.google.com/maps/api/directions/xml?origin">http://maps.google.com/maps/api/directions/xml?origin</a>=" & arrROAD(arrROAD.Length - 1) & "&destination=39.049435,121.782503" & _ "&sensor=false" myWebClient.DownloadFile(strURL, gstrPatch) '*计算 Dim xmlDoc2 As New XmlDocument Dim XmlFileName2 As String = gstrPatch If File.Exists(XmlFileName2) Then xmlDoc2.Load(XmlFileName2) Dim nodeList As XmlNodeList = xmlDoc2.SelectSingleNode("DirectionsResponse").ChildNodes Dim xn12 As XmlNode Dim xn22 As XmlNode Dim xn32 As XmlNode For Each xn12 In nodeList For Each xn22 In xn12 For Each xn32 In xn22 If xn32.Name = "distance" Then strLast = xn32.ChildNodes.Item(1).InnerText End If Next Next Next End If For r As Integer = 0 To arrCalc.Length - 1 douKM = douKM + CType(Replace(arrCalc(r), " km", ""), Double) Next douKM = douKM + CType(Replace(strLast, " km", ""), Double) Else For r As Integer = 0 To arrCalc.Length - 1 douKM = douKM + CType(Replace(arrCalc(r), " km", ""), Double) Next End If '显示距离 KM 单位 txtDISTANCE.Text = douKM Catch ex As Exception MsgBox("获取距离数据失败。") End Try End Sub
.net 里面的每周第一天默认是星期日,实在是不符合中国人的行为习惯。
以下函数 可以返回 传入日期所在星期的第一天,可自定义星期的第一天 是星期一、二、三 … … 日
Private Function FirstDayOfWeek(ByVal day As DateTime, ByVal weekStarts As DayOfWeek) As DateTime Dim d As DateTime = day Do While d.DayOfWeek <> weekStarts d = d.AddDays(-1) Loop Return d End Function