Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: Referencing string member vars Pin
moredip23-Feb-03 11:32
moredip23-Feb-03 11:32 
GeneralHelp with creating a C# web service Pin
Manster23-Feb-03 4:17
Manster23-Feb-03 4:17 
GeneralRe: Help with creating a C# web service Pin
Kannan Kalyanaraman23-Feb-03 5:39
Kannan Kalyanaraman23-Feb-03 5:39 
GeneralStart Menu Shortcuts in C# Pin
CyberKewl23-Feb-03 3:47
CyberKewl23-Feb-03 3:47 
GeneralRe: Start Menu Shortcuts in C# Pin
Stephane Rodriguez.23-Feb-03 7:10
Stephane Rodriguez.23-Feb-03 7:10 
GeneralRe: Start Menu Shortcuts in C# Pin
CyberKewl23-Feb-03 13:23
CyberKewl23-Feb-03 13:23 
GeneralRe: Start Menu Shortcuts in C# Pin
Stephane Rodriguez.24-Feb-03 11:02
Stephane Rodriguez.24-Feb-03 11:02 
Generalfread and Stream Pin
leppie23-Feb-03 2:24
leppie23-Feb-03 2:24 
GeneralBuildAction: Content Pin
leppie23-Feb-03 0:23
leppie23-Feb-03 0:23 
GeneralReusing CodeGuru Software Pin
Josep L Colom23-Feb-03 0:06
Josep L Colom23-Feb-03 0:06 
GeneralRe: Reusing CodeGuru Software Pin
Stephane Rodriguez.23-Feb-03 0:52
Stephane Rodriguez.23-Feb-03 0:52 
GeneralRe: Reusing CodeGuru Software Pin
Josep L Colom23-Feb-03 4:28
Josep L Colom23-Feb-03 4:28 
GeneralRe: Reusing CodeGuru Software Pin
Stephane Rodriguez.23-Feb-03 5:47
Stephane Rodriguez.23-Feb-03 5:47 
GeneralHIGH MERCURY LEVELS IN DOLPHINS Pin
eggie522-Feb-03 19:31
eggie522-Feb-03 19:31 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
leppie22-Feb-03 21:57
leppie22-Feb-03 21:57 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
eggie523-Feb-03 13:19
eggie523-Feb-03 13:19 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
John Karbin24-Feb-03 2:31
John Karbin24-Feb-03 2:31 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
eggie524-Feb-03 4:08
eggie524-Feb-03 4:08 
GeneralRe: HIGH MERCURY LEVELS IN DOLPHINS Pin
John Karbin24-Feb-03 4:29
John Karbin24-Feb-03 4:29 
Generalencrypting question Pin
jtmtv1822-Feb-03 13:29
jtmtv1822-Feb-03 13:29 
GeneralRe: encrypting question Pin
Furty22-Feb-03 17:57
Furty22-Feb-03 17:57 
GeneralRe: encrypting question Pin
jtmtv1822-Feb-03 19:04
jtmtv1822-Feb-03 19:04 
thanks furty i found something that fixed the problem for me using RC2 and memory streams... i used that path class...and sent just the name to the seperate "class" where the name was encrypted and then returned.... apon decryption i send the "encrypted" name back...and it decrypted that string using the same password... you were write on the last part.. i just had no idea how to do it because when i did it...it would encrypt the string and return a name that was too long...for a valid windows file name. the following code encrypted the string and fixed the problem...

thanks... Jesse M


please keep in mind this encryption method i know isnt the correct way to do it...but its just for a file name.. so i did it the easyiest way =)..
public string FilterInName(string pToEncrypt){<br />
			try{<br />
				if(pToEncrypt.Length<=3){<br />
<br />
					return pToEncrypt;<br />
				}<br />
				string sKey = "alPhatab";<br />
				DESCryptoServiceProvider des = new DESCryptoServiceProvider();<br />
				//Put the string into a byte array<br />
				byte[] inputByteArray = Encoding.Default.GetBytes(pToEncrypt);<br />
				//Create the crypto objects, with the key, as passed in<br />
				des.Key = ASCIIEncoding.ASCII.GetBytes(sKey);<br />
				des.IV = ASCIIEncoding.ASCII.GetBytes(sKey);<br />
				MemoryStream ms = new MemoryStream();<br />
				CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(),<br />
				CryptoStreamMode.Write);<br />
				//Write the byte array into the crypto stream<br />
				//(It will end up in the memory stream)<br />
				cs.Write(inputByteArray, 0, inputByteArray.Length);<br />
				cs.FlushFinalBlock();<br />
				<br />
				//Get the data back from the memory stream, and into a string<br />
				StringBuilder ret = new StringBuilder();<br />
				foreach(byte b in ms.ToArray()){<br />
				//Format as hex<br />
				ret.AppendFormat("{0:X2}", b);<br />
				}<br />
				return ret.ToString();<br />
			}catch(Exception ){return pToEncrypt;}


The Code Project Is Your Friend...
QuestionFitting a form in a control? Pin
Arun Bhalla22-Feb-03 11:42
Arun Bhalla22-Feb-03 11:42 
AnswerRe: Fitting a form in a control? Pin
leppie22-Feb-03 12:19
leppie22-Feb-03 12:19 
GeneralRe: Fitting a form in a control? Pin
James T. Johnson22-Feb-03 17:07
James T. Johnson22-Feb-03 17:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.