Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
ApplyLicense(Me.Request.QueryString("valuedata"))
End Sub
Public Shared Function ApplyLicense(ByVal aClientName As String) As Boolean
Try
aClientName = aClientName.Trim
Dim ls_applyfile As String = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + "\" + aClientName + ".lic"
If File.GetAttributes(ls_applyfile).ReadOnly Then File.SetAttributes(ls_applyfile, FileAttributes.Normal)
File.Delete(ls_applyfile)
HttpContext.Current.Response.End()
Return True
Catch ex As Exception
HttpContext.Current.Response.Write("<script language='javascript'>alert('" + "下载错!" + ex.ToString.Replace("\r\n", "\\r\\n") + "');</script>")
Return False
End Try
End Function