|
using System.Security.Cryptography;<br />
using System.IO;<br />
using System.Text;<br />
<br />
public class dataencryption{<br />
private Byte[] KEY_64 ={ 42, 16, 93, 156, 78, 4, 218, 32 };<br />
private Byte[] VAL_64 ={ 55, 103, 246, 79, 36, 99, 167, 3 };<br />
<br />
public dataencryption() {<br />
}<br />
<br />
public string Encryption(string value) {<br />
DESCryptoServiceProvider CryptoProvider=new DESCryptoServiceProvider();<br />
MemoryStream ms = new MemoryStream();<br />
CryptoStream cs = new CryptoStream(ms, CryptoProvider.CreateEncryptor(KEY_64, VAL_64), CryptoStreamMode.Write);<br />
StreamWriter sw = new StreamWriter(cs);<br />
sw.Write(value);<br />
sw.Flush();<br />
cs.FlushFinalBlock();<br />
ms.Flush();<br />
return Convert.ToBase64String(ms.GetBuffer(), 0,Convert.ToInt16(ms.Length));<br />
}<br />
<br />
public string Decryption(string value) {<br />
DESCryptoServiceProvider CryptoProvider = new DESCryptoServiceProvider();<br />
Byte[] buffer=Convert.FromBase64String(value);<br />
MemoryStream ms = new MemoryStream(buffer);<br />
CryptoStream cs = new CryptoStream(ms, CryptoProvider.CreateDecryptor(KEY_64, VAL_64), CryptoStreamMode.Read);<br />
StreamReader sr = new StreamReader(cs);<br />
return sr.ReadToEnd();<br />
}<br />
}
Best Regards
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Hi,
An easy encryption and decryption method.
<br />
public static string Encrypt(string valueToEncrypt)<br />
{<br />
byte []b;<br />
b = ASCIIEncoding.ASCII.GetBytes(valueToEncrypt);<br />
return Convert.ToBase64String(b);<br />
}<br />
<br />
public static string Decrypt(string valueToDecrypt)<br />
{<br />
byte []b;<br />
b = Convert.FromBase64String(valueToDecrypt);<br />
return ASCIIEncoding.ASCII.GetString(b);<br />
}
Mehedi Hasan
|
|
|
|
|
Please could someone help me with this code? The problem appears to be a simple one, but i'm not html or ASP literate and need to modify the below code to add 2 things.
First a bit about the website: It's a news website, which has talkback, where the public register to post comments. One of the options in the comments is for the commentator to leave an email icon, if they want private emails from other readers. The initial email is sent through a form, When someone clicks a link they are taken to this form below, which is a form on a commenting website, where they can send a blind email to the commentator.
Blind email means that they are sending an email to the person's username, and at the same time their own email which will be shown to whomever gets the email. The form's "Name" is where the email will be sent, and the "Name" field has the email in the database, only the "Name" is shown in public (which is the username)
The form has a Name, Subject and Comment section, which they fill in, and then once clicked, the email is sent.
I want to add the following 2 things
1. I want a blind carbon copy of the email sent to "admin@myweb.com" . I have tried the bcc. but can't get it right, don't know where to put it.
2. I also want to add a signature at the bottom of the email, so that it shows it came from my website. Something simple like a few lines of
"You are receiving this email from the talkback at mywebsite.com. It is a response to your talkback message. Thank you for using our talkback"
Could someone tell me what to include and where exactly? I am not familiar with html or ASP. Thank you in advance.
[COLOR="Navy"]
<% Dim ID, RS, SQL, NAME, EMAIL, COMMENT, sDATE, IO, M_ID, SUBJECT, CITY, COUNTRY, ALLOW_E, AID, NEXT_ID, C_NAME, C_EMAIL, MESSAGE, _
blDONE, blLOGGED_IN
ID = Trim(Request.QueryString("ID"))
AID = Trim(Request.QueryString("AID"))
IF IS_VALID_ID(ID) = False OR IS_VALID_ID(AID) = False THEN Response.END
MODE = Request.Form("mode")
IF Trim(Session("PMMS_IN")) = "True" THEN blLOGGED_IN = True
IF MODE = "send" THEN
NAME = Request.Form("name")
EMAIL = Request.Form("email")
CONTENT = Request.Form("content")
Call GET_DETAILS()
IF NAME = "" OR IsNull(NAME) THEN MESSAGE = MESSAGE & "Please enter your name. "
IF EMAIL = "" OR IsNull(EMAIL) THEN MESSAGE = MESSAGE & "Please enter your email address. "
IF CONTENT = "" OR IsNull(CONTENT) THEN MESSAGE = MESSAGE & "Please enter your message. "
IF MESSAGE = "" THEN
Call SEND_EMAIL_OUT(CONTENT, "RE:" & SUBJECT, C_EMAIL, EMAIL, "smtp.mywebsite.com")
blDONE = True
'Response.Redirect "_comment_view.asp?ID=" & ID & "&AID=" & AID
'Response.END
END IF
ELSE
Call GET_DETAILS()
NAME = Session("PMMS_NAME")
EMAIL = Session("PMMS_EMAIL")
END IF
SUB GET_DETAILS()
SQL = "SELECT fldNAME, fldEMAIL, fldCOMMENT, fldDATE, fldIP, fldM_ID, fldSUBJECT, fldCITY, fldCOUNTRY, fldALLOW FROM nm_tbl_comment WHERE ID = " & ID
Call OPEN_DB()
Set RS = Server.CreateObject("ADODB.Recordset")
RS.LockType = 1
RS.CursorType = 0
RS.Open SQL, MyConn
IF NOT RS.EOF THEN
C_NAME = trim(RS("fldNAME"))
C_EMAIL = trim(RS("fldEMAIL"))
SUBJECT = trim(RS("fldSUBJECT"))
ALLOW_E = trim(RS("fldALLOW"))
END IF
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
END SUB
%>
<%IF blDONE = True THEN%>
Thank you. Your email has been sent.
|
<%Response.END%>
<%END IF%>
<%IF NOT MESSAGE = "" THEN%>
<%END IF%>
Send email to: <%=C_NAME%>; | Your Name: | | Your Email: | | <%=CONTENT%> |
|
[/COLOR]
|
|
|
|
|
I have two Radiobutton
if (RadioButton1.Checked==true)
{
RadioButton2.Checked=false;
}
else if(RadioButton2.Checked==true)
{
RadioButton1.Checked=false;
}
when i run this pgm both the radiobutton is checked...I need to check it optionally....Please do needfull...
With Regards,
Samson
|
|
|
|
|
Here u are missing somecode..
samsonx wrote: have two Radiobutton
if (RadioButton1.Checked==true)
{
RadioButton2.Checked=false;
}
else if(RadioButton2.Checked==true)
{
RadioButton1.Checked=false;
}
write this
on RadioButton1's click event write.
RadioButton2.Checked=false;
And on RadioButton2's click event write.
RadioButton1.Checked=false;
hope it will help.
Thanks,
Sun Rays
|
|
|
|
|
no need to write the code just set the same group name for both the radio buttons.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i am using 2 dropdown controls, if the first dropdown's selected index changed time call a method and bind the values in client side, it is displaying fine in the second dropdown control, but while save click i am not getting the selected value from the second dropdown control,
how can i solve the problem,
also what is the property AutoPostBack will do in the dropdown control
Thanks in Advance
-
|
|
|
|
|
Use a hidden field on form and in client script code put value into it (dropdown client onSelectedChanged event)
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
if i put the hiddenfield means when the user changes the second dropdown i am not getting the value
-
|
|
|
|
|
Nope..I think he means that when the seecond dropdown value changed, you have to get the changed value and put it into hidden field
<< >>
|
|
|
|
|
Autopost back means that the page will be posted back to the server on selection change event of the drop down list and probably that would be the cause of your problem also.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
I am Developing web application with a asp.net and C# (framework 1.1). I want to create a pdf document with images and texts. For getting the clarity of images I want to upload pdf images(or any other vector images like .EPS,.CDR formats etc) into the pdf document. And also the images has to be positioned and rotated inside the pdf document. How it can be possible using the .net code? Can anybody help me?
Thanks in advance
Regards
Bejoy
|
|
|
|
|
My answer will not be a .NET way answer but an answer to dealing multi format
vector and non vector medias. Try to use Tex on this kind of management. Because of the human readable syntax of Tex document management system(open source on Windows and Linux), it is possible to do anyting on any document medias. Any media can be prepared and rendered into and from Tex. it is more of a Linux way of solution. Render strings that Tex Requires and select output format, that is it. Google LaTex and tex, give it a go.
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
Hello friends,I want to assign a 3 lines of text to a textbox. The text is assigned but when i click signout ..it displays this error..
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (txtareaurl="
|
|
|
|
|
Make textbox multiLine true or close Page Validation on page settings of the page
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
Add this ValidateRequest="false" into Page directive
<< >>
|
|
|
|
|
Hello
I am a beginner in programming(asp.net-vb)In my application I need to use an Ajax control(Calender)same as that one in ajax.asp.net/toolkit.When I created my application,I choose website.Now I have incorporated ajax in my current ,so what step should I take?
I need to design the calender,when the user clicks the calendar icon,the calender opens,allow the user to choose the date from the calendar(not only the current date,also previous dates) and the date to be entered in the Date Textbox,after the calender to be closed....
How can I do that cause I've got AjaxToolKit in my ToolBox?
oga m
|
|
|
|
|
please help me ..i want to make different windows in a sane web form ,and they should be moved,closed and work independently.....
it can be of a chat window, picture gallary, callender-events like that..
nobz
|
|
|
|
|
look on javascript window.open function it has many parameters to do your job
Look at document.childpage or child Window ? to exchange parameters
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
Two ways spring to mind - put your content in a floating div, then implement d&d for it (pretty trivial), or if you're not in control of the content (i.e. from different URL), put an IFrame in the div first
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
sir...
please can u send me some code for that...??
|
|
|
|
|
Well to make a div absolutely positioned, use something like the following...
<div id="myDivId" style="position:absolute;top:100; left:100"></div>
Then to implement drag & drop, you'd need to hook into the onmousedown / onmouseup / onmousemove events....google will help you with that one.
Once you've got it all together, show the "dialog" and away you go
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
What is the Difference between DrillDown Report and Standered Report?
Thanks inAdvance.
|
|
|
|
|
The session should expire after 10mins & should redirect to login page. Also when user logged, click back button from browser & then clicking forward button,the session should expire & made him to Relogin again,please send code to me as soon as possible.Thanks in advance to whom so ever sending me the code......................
Shiva
|
|
|
|
|
In Web.config add...
<sessionState timeout="10" />
Lets work it Out.........!
|
|
|
|
|