|
<%@ WebService Language="C#" Class="HelloWorld3.WebService" %>
using System.Web.Services;
using DotNetNuke.Entities.Users;
namespace HelloWorld3
{
[WebService(Namespace = "http://ADefWebserver.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService
{
#region GetUsername()
[WebMethod]
public string GetUsername()
{
string strUsername = "World!";
// Get the current user
UserInfo objUserInfo = UserController.GetCurrentUserInfo();
// If the user is not -1 they are logged in
if (objUserInfo.UserID > -1)
{
strUsername = objUserInfo.DisplayName;
}
return strUsername;
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.