Hi..when i am trying to execute the code..its giving the following error:
'PublicServices.GetSignature(string, string)': not all code paths return a value.
the code is:
[WebMethod]
public string GetSignature(string AccessKeyID, string content)
{
try
{
if (AuthorizeUser(AccessKeyID) == false)
{
return "";
}
Encoding myEncoding = new UTF8Encoding();
// Create a new Cryptography class using the
// Secret Access Key as the key
HMACSHA1 myCrypto = new HMACSHA1(myEncoding.GetBytes(mySecretAccessKeyId)) ;
// Calculate the digest
byte[] strDigest = myCrypto.ComputeHash(Convert.FromBase64String(cont ent));
return Convert.ToBase64String(strDigest);
}
catch (Exception ex)
{
sendException(ex);
}
}
public void sendException(Exception ex)
{
SendMail("
[email protected]", "
[email protected]", "errorhandling", "error occured" + ex.StackTrace + "\r\n" + "\r\n" + "error description :" + ex.Message.ToString() + "\r\n" + "\r\n" + "error generated time :" + System.DateTime.Now);
}
public bool SendMail(string from, string to, string subject, string body)
{
try
{
SmtpClient mailObj = new SmtpClient();
mailObj.Host = "mail.retgdsg.com";
MailMessage msg = new MailMessage(from, to, subject, body);
msg.IsBodyHtml = false;
mailObj.Send(msg);
return true;
}
catch (Exception ex)
{
return false;
}
}
could any one help me...in this regard.