Free eBook on Visual Studio 2012 from Telerik


Hi

Here is the excellent free eBook on Visual Studio 2012 from Telerik publication. Here you will learn all the new features of VS 2012 in very easy ways. It is completely free to download.

Free eBook on VS 2012 from Telerik download link

I hope you will enjoy while reading this book.

Advertisement

How to do method overloading in WCF ?



Hi
If you are doing method overloading in WCF then we can not do directly like C#. In WSDL based world,all the operation must have unique name. So we can do this task like this

Step1:Create one WCF application and write the code in “Iservice1” file like this

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace Overloading_WCF
{

[ServiceContract]
public interface IService1
{
[OperationContract(Name=”AddNo1″)]
int AddNo(int val, int val1);

[OperationContract(Name=”AddNo2″)]
int AddNo(int val, int val1, int val2);
}
}

Step 2: Implement the interface in “Service.svc”like this

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace Overloading_WCF
{

public class Service1 : IService1
{

public int AddNo(int val, int val1)
{
return (val + val1);
}

public int AddNo(int val, int val1, int val2)
{
return (val + val1 + val2);
}

}
}

Step3: Compile the service and consume in application

Step4: Write the code in codebehind file like this

protected void btnSum_Click(object sender, EventArgs e)
{
ServiceReference1.Service1Client objProxy=new ServiceReference1.Service1Client();
if (txtNo1.Text != string.Empty && txtNo2.Text != string.Empty)
{
lblSum.Text = objProxy.AddNo1(int.Parse(txtNo1.Text), int.Parse(txtNo2.Text)).ToString();
}
if (txtNo1.Text != string.Empty && txtNo2.Text != string.Empty && txtNo3.Text != string.Empty)
{
lblSum.Text = objProxy.AddNo2(int.Parse(txtNo1.Text), int.Parse(txtNo2.Text),int.Parse(txtNo3.Text)).ToString();
}

}

Sample of Phishing Email


Hi

Recently i got one phishing email from someone, who was trying to take my confidential UserId and Password.

I detected this email as phishing by seeing email id and no one email service provider will try to take your confidential UserId and Password.

You never send reply to this email otherwise on basis of your current UserId and Password they will try to hack lots of confidential information.

You also read my old post, How to detect Phishing Email

I hope it will help to someone.