I am making a web app with unity.
I am trying to use my mojo portal membership.
I have to use yield to read the web page for information.
The following is code I am trying. For some reason it not only gives the query it also gives all the html code as well.
Any thing you can see about why and what I can do?
Unity Code.
if (GUI.Button(new Rect((loginWindow.width / 2) - 50, (loginWindow.height / 2) - 25, 100, 50), "Enter"))
{
StartCoroutine(NameCheck());
}
IEnumerator NameCheck()
{
var scriptCheck = "http://**********/Login.aspx";(location blocked out)
WWW getScript = new WWW(scriptCheck);
yield return getScript;
if (getScript.error == null)
{
header = getScript.text;
}
else
{
header = getScript.error;
}
}
*****************************************************
ASP.net Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" method="post" runat="server" >
<div>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string user = HttpContext.Current.User.Identity.Name.ToString();
HttpContext.Current.Response.Write(user);
}
}