using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; //using System.Threading; using System.Windows.Forms; using System.Security.Cryptography; using System.IO; using System.Web.Services;
namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { //localhost.WebService1 client = new localhost.WebService1(); WindowsFormsApp.ServiceReference1.Service1SoapClient client = new WindowsFormsApp.ServiceReference1.Service1SoapClient(); //WindowsFormsApp.ServiceReference1.WebService1SoapClient client = new WindowsFormsApp.ServiceReference1.WebService1SoapClient(); //上传服务器后的文件名 一般不修改文件名称 int start = textBox1.Text.LastIndexOf("\"); int length = textBox1.Text.Length; string serverfile = textBox1.Text.Substring(start + 1, length - textBox1.Text.LastIndexOf(".")) + DateTime.Now.ToString("-yyyy-mm-dd-hh-mm-ss") + textBox1.Text.Substring(textBox1.Text.LastIndexOf("."), textBox1.Text.Length - textBox1.Text.LastIndexOf("."));
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.IO;
using System.Text;
using System.Security.Cryptography;
using System.Collections.Generic;
namespace WebService1
{
///
/// Service1 的摘要说明
///
[WebService(Namespace = "
http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}