Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Identifier Expected Error

Identifier Expected Error

Scheduled Pinned Locked Moved ASP.NET
helpdata-structuressecurity
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijay_83
    wrote on last edited by
    #1

    this is my code in which i get an error as "Identifier Expected in line: private const SecretSalt = "H3#@*ALMLLlk31q4l1ncL#@..."; _____________________________________________________________________________ private void Page_Load(object sender, System.EventArgs e) { lnkToB.NavigateUrl = CreateTamperProofURL("TamperProofURLs.B.aspx", "NonTamperProof=1", "TP1=Scott&TP2=27"); } //The secret salt... private const SecretSalt = "H3#@*ALMLLlk31q4l1ncL#@..."; public string CreateTamperProofURL(string url, string nonTamperProofParams, string tamperProofParams) { string tpURL = url; if (nonTamperProofParams.Length > 0 || tamperProofParams.Length > 0) { url // ERROR: Unknown assignment operator ConcatString ; } //Add on the tamper & non-tamper proof parameters, if any if (nonTamperProofParams.Length > 0) { url // ERROR: Unknown assignment operator ConcatString ; if (tamperProofParams.Length > 0) url // ERROR: Unknown assignment operator ConcatString ; } if (tamperProofParams.Length > 0) url // ERROR: Unknown assignment operator ConcatString ; //Add on the tamper-proof digest, if needed if (tamperProofParams.Length > 0) { url // ERROR: Unknown assignment operator ConcatString ; } return url; } public string GetDigest(string tamperProofParams) { string Digest = string.Empty; string input = string.Concat(SecretSalt, tamperProofParams, SecretSalt); //The array of bytes that will contain the encrypted value of input byte[] hashedDataBytes; //The encoder class used to convert strPlainText to an array of bytes System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); //Create an instance of the MD5CryptoServiceProvider class System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher = new System.Security.Cryptography.MD5CryptoServiceProvider(); //Call ComputeHash, passing in the plain-text string as an array of bytes //The return value is the encrypted value, as an array of bytes hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(input)); //Base-64 Encode the results and strip off ending '==', if it exists Digest = Convert.ToBase64String(hashedDataBytes).TrimEnd("=".ToCharArray()); return Digest; } In which case do i get that error. pls do help me in solving it. Regards Vijay.

    V 1 Reply Last reply
    0
    • V vijay_83

      this is my code in which i get an error as "Identifier Expected in line: private const SecretSalt = "H3#@*ALMLLlk31q4l1ncL#@..."; _____________________________________________________________________________ private void Page_Load(object sender, System.EventArgs e) { lnkToB.NavigateUrl = CreateTamperProofURL("TamperProofURLs.B.aspx", "NonTamperProof=1", "TP1=Scott&TP2=27"); } //The secret salt... private const SecretSalt = "H3#@*ALMLLlk31q4l1ncL#@..."; public string CreateTamperProofURL(string url, string nonTamperProofParams, string tamperProofParams) { string tpURL = url; if (nonTamperProofParams.Length > 0 || tamperProofParams.Length > 0) { url // ERROR: Unknown assignment operator ConcatString ; } //Add on the tamper & non-tamper proof parameters, if any if (nonTamperProofParams.Length > 0) { url // ERROR: Unknown assignment operator ConcatString ; if (tamperProofParams.Length > 0) url // ERROR: Unknown assignment operator ConcatString ; } if (tamperProofParams.Length > 0) url // ERROR: Unknown assignment operator ConcatString ; //Add on the tamper-proof digest, if needed if (tamperProofParams.Length > 0) { url // ERROR: Unknown assignment operator ConcatString ; } return url; } public string GetDigest(string tamperProofParams) { string Digest = string.Empty; string input = string.Concat(SecretSalt, tamperProofParams, SecretSalt); //The array of bytes that will contain the encrypted value of input byte[] hashedDataBytes; //The encoder class used to convert strPlainText to an array of bytes System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); //Create an instance of the MD5CryptoServiceProvider class System.Security.Cryptography.MD5CryptoServiceProvider md5Hasher = new System.Security.Cryptography.MD5CryptoServiceProvider(); //Call ComputeHash, passing in the plain-text string as an array of bytes //The return value is the encrypted value, as an array of bytes hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(input)); //Base-64 Encode the results and strip off ending '==', if it exists Digest = Convert.ToBase64String(hashedDataBytes).TrimEnd("=".ToCharArray()); return Digest; } In which case do i get that error. pls do help me in solving it. Regards Vijay.

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      vijay_83 wrote:

      private const SecretSalt = "H3#@*ALMLLlk31q4l1ncL#@...";

      Can you try @"H3#@*ALMLLlk31q4l1ncL#@...";?

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups