且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

多用户登录 - 用户添加了哪个文件

更新时间:2023-12-03 18:51:34

通过假设引发任何异常将因为文件已存在而混淆实际异常。

而不是输出您自己的错误消息尝试替换 MsgBox(Ficheiro existente!) MsgBox(e.ToString())以便我们找出实际例外是。



我不记得这里的实际异常的确切措辞(我不会去重新创建所有东西的麻烦),但是看看

You are obfuscating the actual exception by assuming any exception raised will be because the file already exists.
Instead of outputting your own error message try replacing MsgBox("Ficheiro existente!") with MsgBox(e.ToString()) so that we find out what the actual exception is.

I can't remember the exact wording of the actual exception here (and I'm not going to go the trouble of recreating everything), however look at
Query = "INSERT INTO infofile(Filename, Filetype, Filesize, Created, Modified, Access, PcName, TypeUser)
                            VALUES(@Filename, @Filetype, @Filesize, @Created, @Modified, @Access, @PcName, @TypeUser)"



但是当您添加参数时,您已经


but when you are adding parameters you have

.Add("@MoveRecycle", SqlDbType.Char).Value = sentRecycle



您没有为@TypeUser提供值,这将产生错误。


You are not supplying a value for @TypeUser and that will generate an error.