|
Why have you reposted this here? This is not an ASP.NET issue, please use the correct forum. And I notice that you already posted this in Q&A and have been asked to provide details of the error.
Veni, vidi, abiit domum
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Security.Cryptography;
using System.Drawing;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
RSACryptoServiceProvider myrsa = new RSACryptoServiceProvider();
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
openFileDialog1.Title = "Insert Image";
openFileDialog1.ShowDialog();
openFileDialog1.Filter = "JPEG Images|*.jpg|GIF Images|*.gif";
//object r = new object();
EventArgs en = new EventArgs();
string s1 = richTextBox1.Text;
string s2 = richTextBox2.Text;
string s3 = richTextBox3.Text;
string Chosen_File = "";
Chosen_File = openFileDialog1.FileName;
pictureBox1.Image = Image.FromFile(Chosen_File);
byte[] byteData = imageToByteArray(pictureBox1.Image);
string ToS1 = byteData.ToString();
Byte[] newdata = encoding.GetBytes(ToS1);
Byte[] encrypted = myrsa.Encrypt(newdata, false);
for (int i = 0; i < encrypted.Length; i++)
richTextBox4.Text += encrypted[i].ToString();
Byte[] decrypted = myrsa.Decrypt(encrypted, false);//decrypt
pictureBox2.Image = byteArrayToImage(decrypted);
}
public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
return ms.ToArray();
}
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
}
}
Problem in Code :: When we decrypt the image back then it shows an error in "Image.FromStream(ms): during run time.
|
|
|
|
|
1. This has nothing to do with ASP.NET; please use the correct forum.
2. Please put your code between <pre> tags; use the code button above the edit window.
3. Please provide details of the error; where does it occur, and what is the exact text of the message?
Veni, vidi, abiit domum
|
|
|
|
|
Hello,
After converting MVC 4 project to MVC 5 I am getting an error "this website has redirect loop". In my web.config file I have the following:
<authentication mode="Forms">
<forms loginurl="Account/Register" timeout"2880:="">
When I try to click on any menu item, it tries to redirect to /Account/Register page. This was working fine before the conversion. How do I resolve this?
Thanks.
|
|
|
|
|
this code doesnt work in page which has masterpage ?
<asp:content id="Content1" contentplaceholderid="ContentMaster" runat="Server">
<script type="text/javascript">
$(document).ready(function() {
$('html,body').animate({ scrollTop: 150 }, 1000);
});</script>
|
|
|
|
|
Define "doesn't work". Do you get a script error in your browser's developer tools?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
You're missing the point. "It doesn't work" isn't enough information for anyone to diagnose the problem. You need to describe the problem fully, including the full text of any error messages.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for all!
I have used like this and this is working now But how ???????
<script src="~/Script/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("html,body").animate({scrollTop: 230}, 1000);
});
</script>
I was missing :
<script src="~/Script/jquery.min.js" type="text/javascript"></script>
|
|
|
|
|
Member 9473809 wrote: I was missing :
<script src="~/Script/jquery.min.js" type="text/javascript"></script>
That's to be expected. You're using jQuery from your script block, so you need to include the jQuery script before it will work.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how can we create a database design for automated symposium/conference management system
|
|
|
|
|
|
|
hi,
We are trying to convert our asp.net application from targeting to .net 2.0 to .net 4.0 or 4.5. For that what we have done is we changed the application pool to run under .net 4.0 and registered aspnet_regiis from VS2010 command prompt and
set the target framework property of the application in Visual Studio IDE to point to .Net 4.0.
Now the application is not building it is showing errors in xsd, xsds designer and xsds .cs file. I don't know when .Net can convert everything from 2.0 to 4.0 why it cant handle the xsd files.
Is there any ways to convert the xsd files from .net2.0 to .net4.0 automatically, without recreating the xsd files from the scratch, because it is giving the following errors. Please help in solving the problem. Thanks in advance.
Here is the error message:
Error 7 Missing partial modifier on declaration of type 'DIS.CnpWeb.XMLFiles.Model.SurveysDataTable'; another partial declaration of this type exists C:\Abdul\ZZFDPSource\ORFdpProd\XMLFiles\SurveyBalance.cs 319 22 ORFdpProd
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
The error itself doesn't say too much. But as a shot into the dark I'd say that some class has moved into another namespace than it was on .Net 2.0.
You could try to do an incremental update and update to 3.0 first, then to 3.5 and so on, if the error has to do with the framework you can either determine at which version the change affecting you has occured, or you might even see a "Blablabla was deprecated" warning if you are lucky.
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
Hi, you can try changing the web.config file from target framework node from pointing to 2.0 to 4.5 and try.
|
|
|
|
|
1. You answered to the wrong post.
2. Your answer is useless, since the OP already tried that, and THEN his code stopped compiling.
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
Already i have created live application for online exam but some problems my exam category is three type when i select dropdown exammode category so this related exam questions display there are three types of category..
1..MCQ
2..fill in the blanks..
3..true/false..
so please help me..
|
|
|
|
|
How can we help with this information .The Question is not clear.You mentioned some problem exist but you are not describing anything
Get the Selected value of dropdown in SelectedIndexchanged Event and display it.
To learn all there is to know. I know I'll be disappointed one day, but I've made a good start, and the eventual disappointment is likely to be brief.
-Roger Wright
|
|
|
|
|
|
Hello,
how can I calculate the percentage of the occurrences of each word in a text in c #? I would need to draw a graph using the canvasjs charts to represent the number of occurrences of data in general? Where can I find examples? Thank you.
|
|
|
|
|
Where is the problem? Define word borders? Count the total number of words? Count the occurences of a single word? Divide the occurence of a word by the total number of words and multiply with 100? ...?
|
|
|
|
|
hi..
You can use the linq to get the occurence of each word in a string like below ::
string aa = "hey how are you ? where are you going ?";
string[] a = aa.Split(' ');
var qry=from chld in a
select new { name = chld, cnt = (from r in a where r.Equals(chld) select r).Count() * (100 / a.Length) };
|
|
|
|
|
Ehm sorry for inconvenience.
Ehm i would calculate the percentage of values by field value. I will explain:
1) from db i'll select with c# all value from one field
var data = from db in contextDB.CERTIFICATES
where db.TYPEALGORITHM == "typeofalgorithm"
select db <== algorith is a field of my db
i made it for 4 differents algorithm ok?
well i want calculate number of each typeofalgorithm used and transform into percentage and put into pie javascript (I knowhow to do it) but i don't know how to do the percentage calculation and retrieve in
percentage to put into pie.
Thanks!!!
Very Much!
Sorry for my bad english!
|
|
|
|
|
I have to use share this page pluggin in all my web pages.
Can you pls tell me, how it like particular page.
|
|
|
|