且构网

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

如何创建.hp项目的.Exe文件有.Mdf数据库和资源文件夹(图像)

更新时间:2023-08-24 10:06:10

一般来说,对于图像,它应该作为虚拟目录托管在本地IIS服务器中,或者可以在应用程序安装时使用代码手动创建文件夹或者在启动应用程序时,第一次创建一个名为Images的文件夹。



来到数据库,它不能成为应用程序的一部分,您需要作为单独的备份(.bak)文件发送到客户端,并在客户端位置,您需要再次恢复它。



如果您在尝试连接数据库以进行数据库目的时没有对代码中的连接字符串进行硬编码,则可以使用配置文件来配置数据库位置。
Generally for images, it should be hosted in local IIS server as a virtual directory or can be created a folder manually using code, when the application installs or else at the time of launching the application create a folder called "Images" for very first time.

Coming to the database, it cannot be part of the application, you need to ship to the client as a separate backup (.bak) file and in the client location, you need to restore it again.

You can use config files to configure your database location, if you are not hard coding the connection string in the code behind when ever you are trying to connect to the database for db purposes.