制作一个项目想引用脚本文件,用“sb.appendline("<script src='./lib/calc.js'></script>") ”无效后,用 sb.appendline("<script src='.../lib/calc.js'></script>")居然有效,而发布后的项目又不行,这两者有什么不同,帮助文件引用的路径也不太理解,引用绝对路径要怎么设代码?
Dim upathPub As String '通用事件头路径判断
If FileSys.FileExists(ProjectPath & "WeUI.foxdb.bak") = True Then
upathPub = ProjectPath & "\附件"
Else
upathPub = ProjectPath.SubString(0,ProjectPath.length-8)
End If
Dim fl As String = upathPub & e.path '通用事件头
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
Select Case e.Path
Case "EDIT8.htm",""
Dim sb As New StringBuilder
sb.appendLine("<!doctype html>")
sb.appendLine("<html>")
sb.appendLine("<head>")
sb.appendLine("<meta charset='utf-8'>")
sb.appendLine("<title>表单</title>")
sb.appendLine("</head>")
sb.appendLine("<body>")
sb.appendLine("<form enctype='multipart/form-data' method='post' id='form1' name='form1'>")
sb.appendLine("产品: <input name='cp' id='cp'><br/><br/>")
sb.appendLine("客户: <input name='kh' id='kh'><br/><br/>")
sb.appendLine("雇员: <input name='gy' id='gy'><br/><br/>")
sb.appendLine("单价: <input Type='number' name='dj' id='dj' ><br/><br/>") '加上事件触发
sb.appendLine("折扣: <input Type='number' name='zk' id='zk' step='0.01' ><br/><br/>")
sb.appendLine("数量: <input Type='number' name='sl' id='sl' ><br/><br/>")
sb.appendLine("金额: <input Type='number' name='je' id='je' readonly><br/><br/>")
sb.appendLine("日期: <input Type='date' name='rq' id='rq'><br/><br/>")
sb.appendLine("<input Type='submit' name='Sumbit' id='Sumbit' value='确定'>")
sb.appendLine("</form>")
sb.appendline("<script src='.../lib/calc.js'></script>") '引入脚本文件
sb.appendLine("</body>")
sb.appendLine("</html>")
e.WriteString(sb.ToString)
End Select