以文本方式查看主题

-  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=67994)

--  作者:douglas738888
--  发布时间:2015/5/7 17:07:00
--  在学习用户间通讯遇到的问题,请教
调用foxtable2014版的casestudy中的用户间通讯案例进行学习,把原来的“内容”列的16字符改为备注,列属性中的扩展列类型改为了文件;
在窗口1中把“TextBox1”修改成“FileManager1”,想通过发送按钮实现把加载的文件发送给“李四”,点击发送按钮出现“未找到类型“FileManager”的公共成员“Value”。
我修改的代码:Dim re As String = e.Form.Controls("CheckedComboBox1").Value \'获得接收用户名
Dim cn As String = e.Form.Controls("FileManager1").Value \'获得发送内容
If re = "" OrElse cn = "" Then
    Return
End If
If re = User.Name Then
    MessageBox.Show("不能给自己发信息!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
Dim r As Row = Tables("信息表").AddNew()
r("发送者") = User.Name
r("发送时间") = Date.Now
r("接收者") = re
r("内容") = cn
r.Save()
e.Form.Controls("FileManager1").Value = ""
不知这样的代码要如何写?

图片点击可在新窗口打开查看
[此贴子已经被作者于2015/5/7 17:10:20编辑过]

--  作者:Bin
--  发布时间:2015/5/7 17:14:00
--  
没有 Value 这个属性的

要发文件,你直接把 列的值赋值给另外一个列即可

tables("X").current("文件")



--  作者:大红袍
--  发布时间:2015/5/7 17:15:00
--  

1、内容列,如果扩展成文件列,那一定要设置它的存储路径(如果是局域网,必须设置在共享文件夹那里;如果是ftp,就必须设置成远程的方式)

 

2、代码这样写

 

Dim re As String = e.Form.Controls("CheckedComboBox1").Value \'获得接收用户名
Dim cn As String = Tables("某表").Current("绑定FileManager的列")
If re = "" OrElse cn = "" Then
    Return
End If
If re = User.Name Then
    MessageBox.Show("不能给自己发信息!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
Dim r As Row = Tables("信息表").AddNew()
r("发送者") = User.Name
r("发送时间") = Date.Now
r("接收者") = re
r("内容") = cn
r.Save()


--  作者:douglas738888
--  发布时间:2015/5/7 17:26:00
--  
谢谢,我试试!!