简体   繁体   English

从本地计算机访问美国服务器上托管的C#代码

[英]Accessing C# code hosted on US server from Local machine

I have recently created a website in asp.net with c# and hosted it on US server, Now my problem is I want to access its code from local machine, Is it possible to access the code of US server from my local machine? 我最近使用c#在asp.net中创建了一个网站并将其托管在美国服务器上,现在我的问题是我想从本地计算机访问其代码,是否可以从我的本地计算机访问美国服务器的代码? because when any changes suggested by my boss each I want to access that server and do the changes which is tedious task to do, 因为每当老板提出任何更改时,我都想访问该服务器并进行更改,这是一件繁琐的任务,

What I did for same:- 我所做的同样:

  1. I selected the open website in visual studio 2005 and select Remote Site option It ask me for Enter URL of website configured with the FrontPage Server Extensions Under which a textbox appear saying Https:// 我在Visual Studio 2005中选择了打开的网站,然后选择“远程站点”选项。它要求我输入使用FrontPage Server Extensions配置的网站的URL,在其下出现一个文本框,显示Https://

  2. Then I went to US server and install the FrontPage server Extension as told in the web site http://support.microsoft.com/kb/298158 然后,我去了美国服务器并按照网站http://support.microsoft.com/kb/298158的说明安装FrontPage服务器扩展。

What do I enter in the text box of Visual Studio 2005 asking me for Website Location to access my code on US server from my local machine 我要在Visual Studio 2005的文本框中输入什么,要求我提供网站位置,以便从本地计算机访问美国服务器上的代码

You will supply the URL to the site, or FTP credentials to access the files. 您将提供站点的URL或FTP凭据以访问文件。

However, I am going to recommend against this approach, as developing directly against a production server is NEVER a good idea. 但是,我建议不要使用这种方法,因为直接针对生产服务器进行开发从来都不是一个好主意。 A local copy that you then publish off to the server is a more appropriate solution, and in the end will most likely save you a lot of time. 然后将其发布到服务器的本地副本是一个更合适的解决方案,最终很可能会节省大量时间。

You should not access the remote site to make changes directly. 应该访问远程站点直接进行更改。 You should have a server on site that you use for development and testing, and have the code for the site under source control. 您应该在站点上有一台用于开发和测试的服务器,并且该站点的代码受源代码控制。 Then, when you want to make changes you get the project from source control, make the changes there so that they can be tracked, and use the local server to test anything. 然后,当您要进行更改时,可以从源代码管理中获取项目,在此处进行更改,以便可以对其进行跟踪,并使用本地服务器测试任何内容。

Only then do you need to worry about changing anything on the remote server. 只有这样,您才需要担心更改远程服务器上的任何内容。 Normally the way you need to do this is that your service provider for the server will only give you ftp access. 通常,您需要执行此操作的方法是,服务器的服务提供商将仅授予您ftp访问权限。 So you publish from visual studio to your local file system and ftp those files up to the remote server. 因此,您可以从Visual Studio发布到本地文件系统,然后将这些文件通过ftp发送到远程服务器。

This is not the proper way to build ASP.NET web applications. 这不是构建ASP.NET Web应用程序的正确方法。

What you should do is use source control and keep all of your code there. 应该做的是使用源代码管理,并将所有代码保存在此处。 I prefer Subversion. 我更喜欢Subversion。 Then you can deploy your compiled binaries to the server of your choice using the Publish command . 然后,您可以使用“ 发布”命令将已编译的二进制文件部署到您选择的服务器上。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在C#中从服务器访问客户端PC的“ HKEY_LOCAL_MACHINE” - Accessing “HKEY_LOCAL_MACHINE” of client pc from server in C# C#代码中的“ DB2OLEDB提供程序未在本地计算机上注册”异常…从C#访问DB2数据库 - “DB2OLEDB provider is not registered on the local machine” exception in C# code…accessing DB2 database from C# 使用C#.net应用程序访问活动目录中的不同域在本地计算机上工作,但在IIS服务器中托管时不能 - Access to different domain in active directory using C# .net application works in local machine but not when hosted in IIS server C#将.csv文件从本地计算机复制到远程Postresql服务器 - C# copy .csv file from local machine to remote postresql server 如何从 C# 中的服务器端脚本打开本地机器 exe 文件? 我不想要 ActiveXObect - How to open local machine exe file from server side script in c#? I Dont want ActiveXObect c#使用FTP将本地文件上传到服务器。 C#文件位于服务器上 - c# Upload local file to Server using FTP. The c# files are on hosted on the server asp.net c# 代码(从 VS2022 和 IIS10)在本地机器上工作以连接到 SQL Server DB 它在 Web 服务器上不起作用 - asp.net c# code works (from VS2022 and on IIS10) on local machine to connect to SQL Server DB it does not work on Webserver 嵌入式浏览器在本地计算机上下载,但不在Windows Server c#上下载 - Embedded Browser Downloads on Local Machine but not on Windows Server c# 使用 C# 在本地计算机上获取默认 SQL 服务器实例 - Get default SQL Server Instance On Local Machine Using C# C#Web API可在本地计算机上运行,​​但不能在服务器上运行 - C# Web API works on local machine but not on server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM