2011-03-15 50 views
0

嗨全部 我在Delphi中插入Oracle数据库映像文件(创建表(id int,dir varchar2(200),图像blob)。现在我想在dblick上打开该文件的目录(dir) dbimage1 例如:d:\ image.bmp 预先感谢打开文件目录

+0

我不确定我明白你在问什么。你问的是如何在“D:\”打开Shell窗口?你是从'D:\ image.bmp'中提取文件路径吗? –

+0

我想双击dbimage1打开文件时使用Windows传真和图片查看器 – user578332

回答

0

可以使用TOpenPictureDialog让用户选择一个图像文件

+0

我认为OP正在用英文挣扎,但想打开一个文件,他们已经知道文件名和路径,因此没有需要浏览它。 –

+0

@Warren P是最有可能的,但这个问题表明,他实际上使用了TOpenPictureDialog http://stackoverflow.com/questions/5308661/insert-jpeg-files-to-oracle –

2
uses ShellAPI; 

... 

// opens Windows Explorer with the file highlighted 
ShellExecute(Handle, 
      'open', 
      'C:\Windows\explorer.exe', 
      '/start,"' + ImageFileName + '"', 
      nil, 
      SW_SHOWNORMAL); 

// opens the default program associated with the type (extension) of the file, 
// which in your case can very well be Windows Fax and Picture Viewer 
ShellExecute(Handle, 
      'open', 
      nil, 
      '"' + ImageFileName + '"', 
      nil, 
      SW_SHOWNORMAL); 

如果ImageFileName已经包含",在代码中删除它们。以上。

+0

谢谢你的回答,但我需要改变这一点shellapi代码ShellExecute(Handle,'C:\ Windows \ explorer.exe','/ start,''+ mydirectiory +'''',零,SW_SHOWNORMAL);像这样 – user578332

+0

@ user578332:对不起?像什么? –