导航:首页 > IDC知识 > aspnet远程服务器

aspnet远程服务器

发布时间:2020-11-10 21:51:50

1、C#中怎么向远程服务器提交数据

得说清楚点吧 什么样的内容,远程服务器提供什么服务
可以用ftp上传,可以调用服务器的webservice,可以连接服务器的sql来保存,还可以tcp通信服务器上的守护进程

2、用C#怎么实现远程服务器与本地的同步

首先要建立增量数据识别机制,然后可以选择 SSIS , dts或者自己定义服务同步数据

3、C#怎么获取远程服务器端文件

常用的一些方式就是一下几种
1
通过
局域网共享
,你直接用打开文件的方式打开
2
对方服务器提供ftp,http服务,你用对用的方式获取下来
3
你提供FTP或者http服务,对方定时上传到你服务器,你定时去对应目录读取

4、C# 代码访问远程服务器共享目录

这个你可以看看一个映射网络驱动器的源码,映射后访问共享文件夹就和本地文件夹没有区别。
http://www.cnblogs.com/190196539/archive/2011/12/20/2294169.html
有很多类似的代码,百度关键字 c# 映射网络驱动器

5、asp.net 调用远程数据库?想调用远程服务器上的数据库

this.GridView1.datasource=sdr错了!用手机就不去写太多了

6、我要怎么把asp.net 开发的WEB项目发布到远程的 服务器上

404一般是由于没有配置访问文件夹的权限造成的,你的网站目录-右键-属性-里面的权限,添加everyone用户,完全控制权限。另外在你的iis网站节点,权限,勾选访问、脚本之类的。

7、C#远程打开服务器文件夹

C#编程可以通过与服务器建立网络映射,来获取服务器文件夹,代码如下:

[DllImport("mpr.dll", EntryPoint = "WNetAddConnection2")]
public static extern uint WNetAddConnection2([In] NETRESOURCE lpNetResource,string lpPassword,string lpUsername,uint dwFlags);
        [DllImport("Mpr.dll")]
        public static extern uint WNetCancelConnection2(string lpName,uint dwFlags,bool fForce);
        [StructLayout(LayoutKind.Sequential)]
        public class NETRESOURCE
        {
            public int dwScope;
            public int dwType;
            public int dwDisplayType;
            public int dwUsage;
            public string LocalName;
            public string RemoteName;
            public string Comment;
            public string Provider;
        }
            
            statusBarLab.Text = "文件复制开始...";
            NETRESOURCE myNetResource1 = new NETRESOURCE();
            myNetResource1.dwScope = 2;
            myNetResource1.dwType = 1;
            myNetResource1.dwDisplayType = 3;
            myNetResource1.dwUsage = 1;
            myNetResource1.LocalName = "W:";
            myNetResource1.RemoteName = fromDirectory1;
            myNetResource1.Provider = null;
            WNetAddConnection2(myNetResource1, fromPwd, fromUser, 0);
            string[] files1 = Directory.GetFiles(fromDirectory1);
            if (files1.Length > 0)
            {
                foreach (string s in files1)
                {
                    FileInfo objFI = new System.IO.FileInfo(s);
                    File.Delete(toDirectory1 + "\" + objFI.Name.ToString());
                    statusBarLab.Text = "1.删除/" + objFI.Name.ToString();

                    File.Copy("W:" + "\" + objFI.Name.ToString(), toDirectory1 + "\" + objFI.Name.ToString());
                    statusBarLab.Text = "1.复制/" + objFI.Name.ToString();
                }
            }
WNetCancelConnection2("W:", 1, true);

8、.net 在远程服务器上怎么部署啊

是不是支持。。你可以直接联系远程服务器问就是了。。。
发布简单,右键发布网站 把服务器的地址写上就可以了
试一试就知道了

9、asp.net:远程服务器返回错误(405)

这个错误,代表你所访问的网页进行了身份判断?

你是不是提交了数据到那个页面?如果是post数据的话,你试下我的那个方法。

private const string UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3";

public static string PostData(string url,string data)
{
// Convert to bytes

string strReturn = "";

try
{
byte[] obtPostData = Encoding.UTF8.GetBytes(data);
HttpWebRequest orqRequest = (HttpWebRequest)WebRequest.Create(url);
orqRequest.Timeout = 3000;

orqRequest.Method = "POST";
orqRequest.UserAgent = UserAgent;
//orqRequest.Referer = LoginRefererUrl;
orqRequest.ContentType = "application/x-www-form-urlencoded";
orqRequest.ContentLength = obtPostData.Length;
orqRequest.AllowAutoRedirect = false;

// Add post data to request

Stream stream;
using (stream = orqRequest.GetRequestStream())
{
stream.Write(obtPostData, 0, obtPostData.Length);
}

HttpWebResponse orsResponse = (HttpWebResponse)orqRequest.GetResponse();

using (Stream responseStream = orsResponse.GetResponseStream())
{
using (StreamReader streamRead = new StreamReader(responseStream, Encoding.UTF8))
{
strReturn = streamRead.ReadToEnd();
}
}

}
catch(Exception e)
{
//throw new Exception(e.Message);
}

return strReturn;
}

10、C#程序连接远程服务器的数据库

C#程序连接远抄程服务器的数据库
如果知道远程计算机IP地址:
connectionString="Data Source=192.168.0.34\WTMT;Initial Catalog=WtmtDatabase;User ID=sa;pwd=wtmt"
如果知道计算机名:
connectionString="Data Source=计算机名\WTMT;Initial Catalog=WtmtDatabase;User ID=sa;pwd=wtmt"

注:WTMT是实例名

与aspnet远程服务器相关的知识