找到数据库并发生错误 [英] Locate database and error occurs
问题描述
大家好,
我使用ClickOnce部署安装程序,文件将安装在以下路径中:-(我从论坛信息中获取)
[系统驱动器]的子文件夹:\ Documents and Settings \ [用户名] \ Local Settings \ Apps \ 2.0
然后,我尝试找到我的.我在该路径中有3个文件夹.
1.数据
确切路径:C:\ Documents and Settings \ newuser \ Local Settings \ Apps \ 2.0 \ Data \ DGVPMQ8N.2J0 \ RV664HZQ.NKD \ u-su..tion_2cb43422b8a531ac_0001.0000_f544608b27029c79 \ Data
包含我的数据库usurfdb.mdb
2.XYVEQJCM.X4T
包含3个其他文件夹,即清单和2个其他奇怪的文件夹.在这里,它包含我的accept.txt,zafi.ico和我的usurfdb.mdb
3.Z8EWEQ8D.702
在这里,它包含sc1文件夹.确切路径C:\ Documents and Settings \ newuser \ Local Settings \ Apps \ 2.0 \ Z8EWEQ8D.702 \ E1QZ0N3Z.7V8 \ u-su..tion_2cb43422b8a531ac_0001.0000_f544608423892e39
运行程序时,收到错误消息,找不到"C:\ Documents and Settings \ newuser \ Local Settings \ Apps \ 2.0 \ Z8EWEQ8D.702 \ E1QZ0N3Z.7V8 \ u-
su..tion_2cb43422b8a531ac_0001.0000_f544608423892e39 \ usurfdb.mdb"
我想知道为什么在此阶段会发生错误?数据文件夹已经具有usurfdb.mdb数据库.
结果,我的程序在安装到另一台计算机后无法正常工作.
奇怪的是,所有捕获的图像现在都位于[B] C驱动器... [/B]中,而不是指定的sc1文件夹中
在这个问题上,我真的需要一些帮助.
顺便说一下,我刚刚尝试了以下代码:-
Hi all,
I install my program using ClickOnce deployment, the files will be installed in this path:- ( i get from the forum info)
the sub folders of [System Drive]:\Documents and Settings\[User Name]\Local Settings\Apps\2.0
Then, I try to locate mine. I have 3 folder in that path.
1.Data
The exact path : C:\Documents and Settings\newuser\Local Settings\Apps\2.0\Data\DGVPMQ8N.2J0\RV664HZQ.NKD\u-su..tion_2cb43422b8a531ac_0001.0000_f544608b27029c79\Data
Contains my database usurfdb.mdb
2.XYVEQJCM.X4T
contains 3 other folders namely manifests and 2 others weired folders. Here It contains my consent.txt, zafi.ico and again my usurfdb.mdb
3.Z8EWEQ8D.702
In here it contains sc1 folder. the exact path C:\Documents and Settings\newuser\Local Settings\Apps\2.0\Z8EWEQ8D.702\E1QZ0N3Z.7V8\u-su..tion_2cb43422b8a531ac_0001.0000_f544608423892e39
When I run the program, I received an error could not find "C:\Documents and Settings\newuser\Local Settings\Apps\2.0\Z8EWEQ8D.702\E1QZ0N3Z.7V8\u-
su..tion_2cb43422b8a531ac_0001.0000_f544608423892e39\usurfdb.mdb"
I am wondering why an error occurs at this stage? The data folder already have the usurfdb.mdb database.
As a result I my program unable to works after been installed in different computer.
The weired thing all captured image is located now in [B]C drive...[/B] instead sc1 folder as specified
I really need some help on this issues.
By the way I just tried this codes:-
If registeredString Is Nothing OrElse registeredString.ToString = "" Then
registeredString = "Zafi"
Registry.SetValue(keyName, "sc1", registeredString)
Dim applicationFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
IO.Directory.CreateDirectory(IO.Path.Combine({applicationFolderPath, "Zafi"}))
End If
imagename = Replace(Now.Date, "/", "") & "-" & Int(Now.TimeOfDay.TotalSeconds)
sc.CaptureScreen.Save("\sc1" & imagename & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Sc.capturescreen.save =它将调用capturescreen模块并将图像保存在文件夹\ sc1中.可悲的是,这里似乎不起作用
Sc.capturescreen.save = It will call capturescreen module and save the image in folder \sc1. Sadly seems to be not working here
推荐答案
,在新代码的这一行中,您需要向要写入的云端硬盘添加显式调用,或者为[系统驱动器]参考.
sc.CaptureScreen.Save("\ sc1"&imagename&".jpg",System.Drawing.Imaging.ImageFormat.Jpeg)
我可能会创建一个变量来保存位置并在运行时进行设置,以便可以更改注册表中文件的保存位置.
on this line in your new code you need to add either an explicit call to the Drive you want to write to or a [System Drive] reference.
sc.CaptureScreen.Save("\sc1" & imagename & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
I would probably create a variable to hold the location and set that at runtime so that I could change where to hold the files from the registry.
布莱斯,
您能再解释一下吗?
我不明白你的意思.
谢谢队友
Hi Bryce,
Can you explain a little bit further please?
I don''t get what you meant.
Thank you mate
请确保您的代码在此处阅读
Sure your code here should read
sc.CaptureScreen.Save("c:\\sc1" & imagename & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
我想我在这台机器上没有编译器,所以我无法测试它.我将在下班后登录并通过编译器运行它.同样在工作中,我将代码部分保存到注册表中,并且如果我记得的话,也会将其发布.
I think I don''t have a compiler on this machine so I cant test it. I will login late from work and run it through a compiler. Also at work I have the code part to save to the registry and will post that as well if I remember.
这篇关于找到数据库并发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!