<%@ WebService Language="C#" Class="Tecrube" %>
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://www.aaaa.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Tecrube : System.Web.Services.WebService {
public DateTime Tarih;
public Tecrube()
{
Tarih = DateTime.Now;
}
[WebMethod]
public string MerhabaDunya()
{
return Tarih.ToString();
}
}
Using System;
using System.Windows.Forms;
namespace WS_Tecrube_01
{
public partial class Form2 : Form
{
private WebSeTcrb.Tecrube S;
public Form2()
{
InitializeComponent();
S = new WebSeTcrb.Tecrube();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = S.MerhabaDunya();
}
}
}
When i click the Button1 it returns the time when i clicked the button. I
suppose to see the time when the form initiliaze.
What can be the problem ?