以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 指定的网络名不再可用 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=109916) |
-- 作者:fubblyc -- 发布时间:2017/11/22 17:36:00 -- 指定的网络名不再可用 .NET Framework 版本:2.0.50727.5485 Foxtable 版本:2017.4.22.1 错误所在事件:自定义函数pandiandownload 详细错误信息: 调用的目标发生了异常。 指定的网络名不再可用。 老师,下载的页面,出现这个错误,是什么情况呢‘’ 之前也有出现 信号灯 什么的 还有I/O 进程中断 |
-- 作者:有点甜 -- 发布时间:2017/11/22 17:42:00 -- 1、是偶发的错误还是每次都错误?
2、你的文件较大?
3、你里面的代码是怎么写的?执行完函数后,在httprequest事件里面,记得马上return,不要再执行e.writeString的代码。 |
-- 作者:fubblyc -- 发布时间:2017/11/22 19:02:00 -- Dim fl1 As String = "D:\\wwwroot\\bbs.yijiansoft.net\\wwwroot\\mobo\\" Dim wb As New weui Dim e As RequestEventArgs = args(0) Dim filter As String = " 门店名称 = \'" & e.Cookies("md") & "\' and 日期 = \'" & e.Cookies("pdrq") & "\' " Dim bm As String = "查询表1" & Rand.Next() Dim jb As New SQLJoinTableBuilder(bm, "明细表") jb.C jb.AddCols("门店名称") jb.AddCols("库位") jb.AddCols("条码") jb.AddCols("数量") jb.Filter = filter \'jb.Distinct = True jb.Build() Dim ex As New Exporter \'& "pandianriqi" & e.Cookies("pdrq") Dim name As String = e.Cookies("md") & Date.Today & "ri" & Date.now.hour & "shi" & Date.now.Minute & "fen" & Date.now.Second & "miao" Dim name2 As String = e.Cookies("md") & Date.Today & "ri" & Date.now.hour & "shi" & Date.now.Minute & "fen" & Date.now.Second & "miao.txt" ex.SourceTableName = bm \'指定导出表 "盘点明细表" ex.FilePath = "C:\\inetpub\\wwwroot\\pandian\\" \'& name ex.Fields = "库位,条码,数量" \'指定导出字段 ex.Format = "Delimited" ex.Header = False ex.NewTableName = name ex.Export() \'开始导出 DataTables.UnLoad(bm) Dim lj As String = "C:\\inetpub\\wwwroot\\pandian\\" & name2 Dim str As String = FileSys.ReadAllText(lj, Encoding.Default) str = str.replace("""", "") FileSys.WriteAllText(lj, str, False, Encoding.Default) Dim fs As System.IO.FileStream = Nothing fs = System.IO.File.Open(lj, System.IO.FileMode.Open) Dim btFile As Byte() = New Byte(fs.Length - 1) {} fs.Read(btFile, 0, Convert.ToInt32(fs.Length)) fs.Close() e.Response.Headers("Content-Disposition") = "attachment;filename=" & name2 \'输出文件格式 e.Response.C Dim output = e.response.OutputStream output.Write(btFile,0,btFile.Length) output.Close() 甜老师你意思是说在最后加上 return 是吗?我试试
[此贴子已经被作者于2017/11/22 19:03:35编辑过]
|
-- 作者:有点甜 -- 发布时间:2017/11/22 22:04:00 -- 试试close不要写,这句代码删掉 output.Close()
在httprequest调用完函数的后面,加上return的代码。 |
-- 作者:fubblyc -- 发布时间:2017/11/23 13:54:00 -- 甜老师,我这样写了: Case "pandiandownloadtxt.txt" Functions.Execute("pandiandownloadtxt",e) Return 然后 注释掉了 output.Close() , 还是会出现这种情况。 |
-- 作者:有点甜 -- 发布时间:2017/11/23 15:09:00 -- 只要是访问 pandiandownloadtxt 的时候,才会出现这种问题?加入msgbox,看执行到哪句代码开始报错。
|