在另一台计算机上运行我的应用程序需要什么? [英] What Do I Need To Run My Application On Another Computer?

查看:194
本文介绍了在另一台计算机上运行我的应用程序需要什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用visual studio 2010和sql server 2008 r2 sp1(mdf数据库)完成了我的C#.net应用程序,我问你在另一台计算机(客户端计算机)上运行它需要什么。 />
这是我的应用程序中的一些代码。

Hi, i finished my C#.net Application using visual studio 2010 and sql server 2008 r2 sp1(mdf databse),and i'm asking you what do i need to run it on another computer(client computer).
this is some code from my application.

string cs = "Data Source=.\\SqlExpress; Integrated Security=True; AttachDbFilename=C:\\Dream Design\\Gestion De Caffée\\Coffee_Shop.mdf; User Instance=true;";



和应用程序配置文件:


and on the app config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="Coffee_ShopEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=c:\Dream Design\Gestion De Caffée\Coffee_Shop.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

推荐答案

您需要.NET Framework的兼容版本(可以自由重新分发,您可以随软件一起分发;通过安装程序或任何方式)和兼容的SQL服务器。

我建议将SQL作为您的应用程序的先决条件,因为用户可以使用他们可能拥有的许可证。

然后,你需要你的申请。



你的申请可能取决于我不知道的其他东西。您需要自己检查。



-SA
You need compatible version of .NET Framework (which is freely re-distributed, you can distribute it with your software; via the installer or anyhow) and compatible SQL server.
I would advise to claim SQL as a prerequisite for your application, as then the user could use the license they might have.
And then, you need your application.

It is possible that your application depends on something else I am unaware of. You will need to check it by yourself.

—SA


1-配置你的sql服务器在这里: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx [<一个href =http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx\"target =_ blank title =新窗口> ^ ]

2-为数据库创建用户,如下所示: http://www.youtube.com/watch?v=rbd1aOt8H94 [ ^ ]

3-将连接字符串设置为:https://www.connectionstrings.com/sql-server-2008/ [ ^ ]

4-如果需要,可以在客户端隐藏连接字符串,如下所示: App.Config文件的加密解密连接字符串 [ ^ ]



这使您的应用程序为远程数据库做好准备连接。最好检查其他依赖项。但是,如果您创建ClickOnce设置,它会使您的工作更轻松。看看这个: http://msdn.microsoft.com/en- us / library / bb546051%28v = vs.90%29.aspx [ ^ ]
1- Configure your sql server as here: http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx[^]
2- Create a user for your db as here: http://www.youtube.com/watch?v=rbd1aOt8H94[^]
3- Set your connection string as here: https://www.connectionstrings.com/sql-server-2008/[^]
4- If you want, you can hide your connection string on client as here: Encryption Decryption Connection String for the App.Config File[^]

This makes your application to be ready for remote db connection. It is better to check other dependencies. But if you create a ClickOnce setup, it makes your job easier. Check out this: http://msdn.microsoft.com/en-us/library/bb546051%28v=vs.90%29.aspx[^]


这篇关于在另一台计算机上运行我的应用程序需要什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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