Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ComputerSite.Controllers
- {
- public class HomeController : Controller
- {
- public ActionResult Index()
- {
- return View();
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>@ViewBag.Title - Computers for you!</title>
- @Styles.Render("~/Content/boot")
- @Scripts.Render("~/bundles/modernizr")
- @Scripts.Render("~/bundles/jquery")
- @Scripts.Render("~/bundles/jqueryval")
- @Scripts.Render("~/bundles/ajaxgroup")
- @Scripts.Render("~/bundles/bootstrap")
- @Scripts.Render("~/bundles/datatables")
- @Scripts.Render("~/bundles/tawk")
- @if (Request.IsAuthenticated)
- {
- string text = UserHelper.GetUserEmail(User.Identity.Name), key = "MY APIKEY";
- System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
- Byte[] textBytes = encoding.GetBytes(text);
- Byte[] keyBytes = encoding.GetBytes(key);
- Byte[] hashBytes;
- using (System.Security.Cryptography.HMACSHA256 hash = new System.Security.Cryptography.HMACSHA256(keyBytes)) { hashBytes = hash.ComputeHash(textBytes); }
- string hashTxt = BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
- <script type="text/javascript">
- Tawk_API.onLoad = function(){
- Tawk_API.setAttributes({
- 'name' : '@User.Identity.Name',
- 'email': '@UserHelper.GetUserEmail(User.Identity.Name)',
- 'hash': '@hashTxt'
- }, function (error) {});
- };
- </script>
- }
- @RenderSection("scripts", required: false)
- </head>
- <body>
- @{ Html.RenderPartial("_navBar"); }
- <div class="container body-content">
- @RenderBody()
- <hr />
- <footer>
- <p>© @DateTime.Now.Year - Building computer for you by you!</p>
- </footer>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement