将文件保存到应用程序-VB应用程序可以接受外部文件吗 [英] Saving a file TO an application - Can A VB Application accept an external file

查看:100
本文介绍了将文件保存到应用程序-VB应用程序可以接受外部文件吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做的是将文件发送到Visual Studio(VB)编写的应用程序.通过选择网页上的保存按钮可以激活保存对话框.我可以选择将文件保存到磁盘或将其发送到我选择的应用程序.

:confused:你能告诉我如何将文件作为数据文件读入Visual Basic应用程序吗?换句话说,我该如何对VB应用程序进行编程以接受发送给它的此类文件?我很难通过自己的研究来发现如何做到这一点. :confused:

该动作不必激活程序,因为它已经在运行.但是我确实需要以某种方式将其读入变量对象.如果有所不同,文件流也将通过我的浏览器从互联网进入.

谢谢.

What I need to do is send a file to a visual Studio (VB) written application. The save dialog is activated by selecting the save button on the web page. I am presented with a choice of saving the file to disk OR sending it to an application of my choice.

:confused: Can you tell me what it takes to have the file be read into a Visual basic application as a data file? In other words how do I program a VB app to accept such a file sent to it? I''m having a hard time finding out how to do this with my own research. :confused:

The action does not have to activate the program since it will already be running. But I do need to read it into a variable object somehow. The file stream will also be coming in from the internet through my browser if that makes a difference.

Thanks.

推荐答案

我假设您的意思是当从互联网上保存文件时要求保存此文件"或使用...打开".您要选择您的应用程序.

这通过标准Windows文件关联(文件扩展名,即gif,jpg,xls等)起作用.
根据与应用程序建立文件关联的方式,它将使用DDE(尽管我恐怕对DDE不太了解),否则它将通过命令行参数传递文件名进入程序.

在VB6中,可以通过Command()函数读取命令行参数
I''m assuming you mean when saving a file off the internet when it asks "Save this File", or "Open with ..." you want to select your application.

This works by the standard Windows file association (File extensions, ie. gif, jpg, xls etc.).

Depending on the way the file association is set up with your application, it''ll use DDE (I''m afraid I don''t know much about DDE though), or it will pass the file name as a command line parameter to the program.

In VB6, the commandline parameters can be read by the Command() function


这篇关于将文件保存到应用程序-VB应用程序可以接受外部文件吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆