|
Encryption would perhaps be a bit over the top. It should probably be sufficient with some scrambling.
You could seed the random generator with a specific number, so that you get a predictable sequence of random number, then pick a random number between 0 and 255 for each character in your text, and do an xor between the character code and the random number. Output the value as a (two digit) hexadecimal number instead of as a character, so that you won't get unprintable characters.
Do decode the value, just seed the random generator with the same number, create the same random numbers and xor with the values from the scrambled code.
---
b { font-weight: normal; }
|
|
|
|
|
So basically your looking for a poor man's SSL???
It is possible, but it's not easy...
You will need to find an encryption algorithm (ie: blowfish, RSA, etc) written in both Javascript and ASP.
I think: Using Javascript you will can capture the onsubmit() and call your encryption function passing it the string you want to encrypt.
Here is the tricky part:
Most easy to use encryption algorithms like RSA, Blowfish, etc are private-key encryption algorithms, which means you use the same password for both encryption and decryption.
This makes for an interesting problem:
How do you encrypt your data on the client side using the same password you will use to decrypt it on the server side of things??? You need to store the password in Javascript somewhere in order to encrypt properly...
If a password is stored in Javascript...you just lost all security
There is the caveat in encrypting/decrypting data over an HTTP connection. You can do it, but there is almost no point...
However, I have considered the following technique in the past to circumvent this problem.
You have the user enter the password in a FORM password element and encrypt/decrypt using this dynamically provided password instead of hardcoded passwords visible to anyone who knows how to save a web page to their harddrive.
Again a problem arises: Can you request a user to enter a password each and every time you submit the encrypted string?
Cheers
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
|
I create buttons dynamically using:-
Button buttonKeyboard = new Button();
buttonKeyboard.Text = "Keyboard";
buttonKeyboard.ID = "buttonKeyboard" + rowCount.ToString();
buttonPH1.Controls.Add(buttonKeyboard);
// Add a spacer in the form of an HTML element
buttonPH1.Controls.Add(new LiteralControl(" "));
How do I assign an on-click event that will call a specific method.
Clueless
|
|
|
|
|
Most likely with buttonKeyboard.Click += new Eventhandler (etc) Not sure what event handler that would be, check out the VS.NET intellisense.
|
|
|
|
|
Hi
i have a web service and a web method .
this method doesnt return any thing and perform some task .but it consumes my time ( 1 minute )to do its job.How i can only call the method ( only send a message to do its job) to overcome this problem.
|
|
|
|
|
Please dont double post.
---
b { font-weight: normal; }
|
|
|
|
|
Examples taken here :
http://pear.php.net/manual/en/package.webservices.xml-rpc.examples.php
Client : Client.php
<?<br />
<br />
ini_set("include_path", 'D:\Program Files\XML_RPC\;'. ini_get("include_path"));<br />
<br />
require_once 'RPC.php';<br />
<br />
$input = 8;<br />
$params = array(new XML_RPC_Value($input, 'int'));<br />
$msg = new XML_RPC_Message('times2', $params);<br />
<br />
$cli = new XML_RPC_Client('xmlrpc.php', '');<br />
$resp = $cli->send($msg);<br />
<br />
if (!$resp) {<br />
echo '>Communication error: ' . $cli->errstr ;<br />
exit;<br />
}<br />
<br />
if (!$resp->faultCode()) {<br />
$val = $resp->value();<br />
echo $input . ' times 2 is ' . $val->scalarval();<br />
} else {<br />
<br />
echo 'Fault Code: ' . $resp->faultCode() . "\n";<br />
echo 'Fault Reason: ' . $resp->faultString() . "\n";<br />
}<br />
<br />
<br />
?><br />
Server : xmlrpc.php
<?<br />
<br />
ini_set("include_path", 'D:\Program Files\XML_RPC\;'. ini_get("include_path"));<br />
<br />
require_once 'Server.php';<br />
<br />
function returnTimes2($params) {<br />
$param = $params->getParam(0);<br />
<br />
if (!XML_RPC_Value::isValue($param)) {<br />
return $param;<br />
}<br />
<br />
$val = new XML_RPC_Value($param->scalarval() * 2, 'int'); <br />
return new XML_RPC_Response($val);<br />
}<br />
<br />
$server = new XML_RPC_Server(<br />
array(<br />
'times2' =><br />
array(<br />
'function' => 'returnTimes2'<br />
)<br />
)<br />
);<br />
<br />
?><br />
But when i run client.php it generates :
Communication error : Operation successfull
Whithout any retrieved code from server ...
But Why ?
|
|
|
|
|
Hello there, I am tring to get the current cursor position in textarea. I'd like to know How I can get the current cursor position ( Not the mouse cursor position) in the textarea? I tried but cannot find it in the document tree. In there a way to get that?
thank you very much in advance.
Bin
|
|
|
|
|
I believe what you are refering to is called the caret.
Anyways, you could possibly use the TextRange object???
HTH
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
I have just finished my first ever Wed Site, but not yet hosted it.
Was thinking of using KF Server to host the site on my home PC. Is this a good idear? Or would it be best to when I buy my domain name have it hosted on there sever.
The next question I have is regarding sending out e-mails (via my 'Contact Us' page).
I was going to use AspEmail, but looking at the documentation, what do I specifify for the following field?
Mail.Host = "smtp.mycompany.com" ' Required
My ISP is BTinternet.com, so should it be smtp.BTinternet.com?
Or do I install a mail server!
Any comments please.
|
|
|
|
|
If you use your home PC as a web server you will need a dynamic domain name, so that you can automatically change the IP number that the domain name points to whenever your IP number changes.
When sending mail you specify the same smtp server as you do in your mail program. You should have the address of the server in the information you got from your ISP.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your post.
Just two more questions if you please.
1. Are dynamic domain names more difficult to get hold off. I was going to use www.noip.com to register one.
2. If I test out my Wed site on another PC on my LAN, with just hotmail availble, what would I specify for the smto server - the same as for the Gateway PC?
Many thanks,
grahamfff
|
|
|
|
|
I have url. I want to load page and save it on disk. In principle I can load it with aid of Web Browser control.
Is there way to save complete web page with aid of script?
or
Is there another way to save complete web page programmaticly?
or may be
Is there function which load url and save its content on disk?
|
|
|
|
|
You can do that with internet explorer, it's in the save options.
There is this example to do it programatically with .net http://www.codeproject.com/vb/net/MhtBuilder.asp[^].
You should be able to something similar with COM and the web browser control.
|
|
|
|
|
I am working on a VB.NET project which has two pages in it. When I click a node in the left menu then a right page loads. Basically I am doing this on the client side using javascript, i.e I apply xslt on a xml on the client side to render HTML to the right frame.
Now I need to include a splash screeen which pops up before the right page loads.Can any body help me on this either using javascript or in vb.net.If some body can post some code it will be of great help.
Thanks in advance,
|
|
|
|
|
You need to use window.open to redirect to a URL that shows the splash screen, and contains a timer to close itself ( so it behaves like a splash screen ). window.open may be wrong, I haven't used jscript for a long time, thank goodness.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
I haven't used jscript for a long time, thank goodness .
Sorry ,but why is this in red block ?
|
|
|
|
|
Hello, all,
How can I make the height of a textarea box changes dynamically based on how many rows in the textarea. So when the user are typing, if the content of the textarea needs more room to display, a new row will be added to the textarea. Is it possible to do this? How can I detect that a new line is generated?
Thank you very much in advance.
Bin
|
|
|
|
|
Hi there,
To dynamically increase the height of the textarea, you simply set the rows property. Normally, the user presses Enter to begin a new line, so you can check that to decide if you need to increase the rows property of the textarea. Here is the sample code for doing that:
function AddRow(e)
{
if(e.keyCode == 13)
{
var txtArea = document.getElementById("TEXTAREA1");
txtArea.rows = txtArea.rows + 1;
}
}
<TEXTAREA id="TEXTAREA1" onkeypress="AddRow(event);" ... ></TEXTAREA> Also, you might need to check when the user pastes the text into the textarea. However, when the rows is too big, the textarea won't look friendly, and I'm curious why the auto scrollbar does not help you here.
|
|
|
|
|
Hello, thanks for your reply. I'd like to know how I can detect the soft wrap return. I mean when the user keep typing to the end of the row, there will be a soft return inserted and a new line will be added. Is there a way to detect this?
I will put the textbox control in a table and make the height of that row and text box increase to fit the user's input. Why do I do this? Because in our desktop version software, we did it that way. My boss would love to see a web application can do it in the same way.
|
|
|
|
|
I'm not sure if there is a way to detect the soft line break since I haven't tried it yet. But IMHO, since the long text is automatically wrapped, so the soft line break might be detected based on the current position of the caret. If the new curent position while the user is typing is set back to 0, then perhaps a soft line break is added. If the new position is not reset, you can compare the value with the cols property of the textarea to check if there is a soft line break. Just an idea.
|
|
|
|
|
Thank you very much for your reply.
Can you tell me how I can get the current cursor position ( Not the mouse cursor position) in the textarea? I tried but cannot find it in the document tree.
|
|
|
|
|
Hi,
actually, all you need to do is to change the default overflow handling of the textarea control to "visible", like this:
<textarea id="textArea" style="overflow:visible"></textarea>
--
Regards,
Dag
|
|
|
|
|
hello , i wana have ado with javascript but i have some problems , help me with one simple sample that connect Access file to ado and that's all !!
Have good day and time
|
|
|
|