以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  存储地址错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=59367)

--  作者:yifan3429
--  发布时间:2014/11/3 9:15:00
--  存储地址错误
.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2014.10.23.1
错误所在事件:表,产品数据库,DataColChanged
详细错误信息:
调用的目标发生了异常。
未将对象引用设置到对象的实例。



If e.DataCol.Name = "产品效果图" Then
    If e.NewValue <> Nothing Then
        Dim file As String = Vars("IP2") & e.NewValue
        Dim img As image = getImage(file)
        Dim bmp As new bitmap(getImage(file), img.width / 5, img.height / 5)
        file = "d:\\产品缩略图\\"  & e.NewValue
        Dim path As String = file.Replace(FileSys.GetName(file),"")
        If FileSys.DirectoryExists(path) = False Then \'如果目录C:\\MyFolder存在
            FileSys.CreateDirectory(path)
        End If
        bmp.save(file)
        
        bmp.Dispose
    End If
    e.DataRow("缩略图") = e.NewValue
End If

--  作者:Bin
--  发布时间:2014/11/3 9:20:00
--  
Dim file As String = Vars("IP2") & e.NewValue
If FileSys.FileExists(file Then

        Dim img As image = getImage(file)



end if

--  作者:yifan3429
--  发布时间:2014/11/3 9:33:00
--  
修改后文件名会正常  但是缩略图文件不会存到  "D\\文件检索图\\"  打开出现叉叉
  
If e.DataCol.Name = "产品效果图" Then
    If e.NewValue <> Nothing Then
        Dim file As String = Vars("IP2") & e.NewValue
        If FileSys.FileExists(file ) Then
            Dim img As image = getImage(file)
            Dim bmp As new bitmap(getImage(file), img.width / 5, img.height / 5)
            file =  "D\\文件检索图\\"  & e.NewValue
            Dim path As String = file.Replace(FileSys.GetName(file),"")
            If FileSys.DirectoryExists(path) = False Then \'如果目录C:\\MyFolder存在
                FileSys.CreateDirectory(path)
            End If
            bmp.save(file)
            
            bmp.Dispose
        End If
        e.DataRow("缩略图") = e.NewValue
    End If
End If



--  作者:有点甜
--  发布时间:2014/11/3 9:35:00
--  
 路径写错了啊 file =  "D:\\文件检索图\\"  & e.NewValue
--  作者:yifan3429
--  发布时间:2014/11/3 10:18:00
--  
文件还是不能存到"D:\\文件检索图\\" 叉叉无效文件

If e.DataCol.Name = "产品效果图" Then
    If e.NewValue <> Nothing Then
        Dim file As String = Vars("IP2") & e.NewValue
        If FileSys.FileExists(file ) Then
            Dim img As image = getImage(file)
            Dim bmp As new bitmap(getImage(file), img.width / 5, img.height / 5)
            \'file =  "D:\\文件检索图\\"  & e.NewValue
            file =  "D:\\文件检索图\\"  & e.NewValue
            Dim path As String = file.Replace(FileSys.GetName(file),"")
            If FileSys.DirectoryExists(path) = False Then \'如果目录C:\\MyFolder存在
                FileSys.CreateDirectory(path)
            End If
            bmp.save(file)
            
            bmp.Dispose
        End If
        e.DataRow("缩略图") = e.NewValue
    End If
End If

--  作者:有点甜
--  发布时间:2014/11/3 10:22:00
--  

 1、你的缩略图列的列属性的存放路径要设置成 D:\\文件检索图\\

 

 2、你自己去确认一下缩略图是否有生成啊


--  作者:yifan3429
--  发布时间:2014/11/3 10:36:00
--  
确认地址对的
就是不显示

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20141103102536.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20141103102521.jpg
图片点击可在新窗口打开查看


--  作者:有点甜
--  发布时间:2014/11/3 10:39:00
--  

1、加入代码 msgbox(e.DataTable.DataCols("缩略图").defaultfolder)

 

2、加入代码 msgbox(file) 、 msgbox(e.newvalue)

 

对比结果。


--  作者:yifan3429
--  发布时间:2014/11/3 11:09:00
--  

 msgbox(file)
---------------------------
产品管理中心.DataTable.A1L5li2Ck5yq68Xff
---------------------------
\\\\192.168.18.248\\天禧家$\\客户管理\\产品库2014产品库\\1.设计方案\\固装方案\\A 效果图片\\SJFB0001固装方案.jpg
---------------------------
确定   
---------------------------

msgbox(e.newvalue)
---------------------------
产品管理中心.DataTable.A1L5li2Ck5yq68Xff
---------------------------
2014产品库\\1.设计方案\\固装方案\\A 效果图片\\SJFB0001固装方案.jpg
---------------------------
确定   
---------------------------

msgbox(e.DataTable.DataCols("缩略图").defaultfolder)
---------------------------
产品管理中心.DataTable.A1L5li2Ck5yq68Xff
---------------------------
D:\\文件检索图\\
---------------------------
确定   
---------------------------



[此贴子已经被作者于2014-11-3 11:11:25编辑过]

--  作者:有点甜
--  发布时间:2014/11/3 11:11:00
--  

那就有问题啊,根本就不是D盘的路径

 

msgbox(e.DataTable.DataCols("缩略图").defaultfolder)