參考網址:http://msdn.microsoft.com/zh-tw/library/ms229862(v=vs.100).aspx#findingthecorrectversion
Aspnet_regsql.exe 安裝在 Microsoft .NET Framework 目錄中。 如果電腦正在並存執行多個 .NET Framework 版本,就可能會安裝此工具的多個版本。 下表將針對不同的 .NET Framework 版本列出此工具的安裝位置。
.NET Framework 的版本 |
Aspnet_regsql.exe 檔案的位置 |
---|---|
.NET Framework 2.0 版、3.0 版和 3.5 版 (32 位元系統) |
%windir%\Microsoft.NET\Framework\v2.0.50727 |
.NET Framework 2.0 版、3.0 版和 3.5 版 (64 位元系統) |
%windir%\Microsoft.NET\Framework64\v2.0.50727 |
.NET Framework 4 版 (32 位元系統) |
%windir%\Microsoft.NET\Framework\v4.0.30319 |
.NET Framework 4 版 (64 位元系統) |
%windir%\Microsoft.NET\Framework64\v4.0.30319 |
Sub SendMail_godaddy(ByVal Subject As String, ByVal Body As String, ByVal FromMail As String, ByVal ToMail As String)
Dim objMail As New System.Web.Mail.MailMessage()
objMail.From = FromMail
objMail.To = ToMail
objMail.Subject = Subject
objMail.BodyFormat = Mail.MailFormat.Html
objMail.Priority = Mail.MailPriority.High
objMail.Body = Body
System.Web.Mail.SmtpMail.SmtpServer = UW.Mail.SMTP_SERVER_NAME
System.Web.Mail.SmtpMail.Send(objMail)
End Sub
Sub SendMail_gmail(ByVal Subject As String, ByVal Body As String, ByVal FromMail As String, ByVal ToMail As String)
Dim msg As New System.Net.Mail.MailMessage
Dim client As New System.Net.Mail.SmtpClient
Try
msg.Subject = Subject
msg.Body = Body
msg.From = New System.Net.Mail.MailAddress(FromMail)
msg.To.Add(ToMail)
msg.IsBodyHtml = True
client.Host = "smtp.gmail.com"
Dim basicauthenticationinfo As System.Net.NetworkCredential = New System.Net.NetworkCredential("username@gmail.com", "password")
client.Port = Int32.Parse("587")
client.EnableSsl = True
client.UseDefaultCredentials = False
client.Credentials = basicauthenticationinfo
client.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
client.Send(msg)
Catch ex As Exception
UW.WU.DebugWriteLine(ex.ToString, True, True)
End Try
End Sub
'更新
If UW.WU.IsNonEmptyFromQueryStringOrForm("Refresh") Then
System.Web.HttpContext.Current.Cache.Remove(CacheName)
End If
'快取部分
If obj Is Nothing Then
Dim SQL As String = ""
SQL = "select * from Product with (nolock)"
obj = UW.SQL.DTFromSQL(SQL)
Dim AC As New AggregateCacheDependency
Dim DepArray() As CacheDependency = { _
New SqlCacheDependency(UW.SQL.sqlCacheDependencyName, "Product"), _
New SqlCacheDependency(UW.SQL.sqlCacheDependencyName, "Product_Category") _
}
AC.Add(DepArray)
Dim FD As New CacheDependency(UW.Template.TemplateRoot & "2013UI\Product\DirectBuyAllProduct.html")
AC.Add(FD)
System.Web.HttpContext.Current.Cache.Insert(CacheName, obj, AC)
End If