|
First I suggest you have a good rat through Teleriks demos, they are usually pretty comprehensive. That should show you how to wire up the buttons and identify the content of the row that was clicked.
From that information you can get the data from the underlying collection to be passed to the second form.
Once you have that do some research on passing data between forms - there are plenty of examples.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i'am trouble to execute base encode 64
this is the error message:
The name 'EncodePasswordToBase64' does not exist in the current context
|
|
|
|
|
Base64 is not an encryption function: it is a translation function. As a result, it is about as secure as having your password tattooed on your forehead backwards so nobody can read it except you with a mirror.
Stop trying to encrypt passwords at all - it is a very poor idea: Password Storage: How to do it.[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
thanks but
what is lacking for the program, please solution. thanks 
|
|
|
|
|
How are we supposed to know?
All you've said is that some symbol is not found in your code, which means you haven't defined it anywhere. Chances are really good you copied and pasted some code from somewhere and you have no idea what it does or how it works, correct? Well, we don't know what that symbol is supposed to be either.
Griff is correct. It looks like you're trying to encrypt a password. DO NOT DO THIS! He already gave a link to show you how to hash and store passwords correctly. Use it.
|
|
|
|
|
 this is the code, the problem still to same like above ??
public static string EncodePasswordToBase64(string password)
{
try
{
byte[] encData_byte = new byte[password.Length];
encData_byte = System.Text.Encoding.UTF8.GetBytes(password);
string encodedData = Convert.ToBase64String(encData_byte);
return encodedData;
}
catch (Exception ex)
{
throw new Exception("Error in base64Encode" + ex.Message);
}
}
public string DecodeFrom64(string encodedData)
{
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(encodedData);
int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
char[] decoded_char = new char[charCount];
utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
string result = new String(decoded_char);
return result;
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text=EncodePasswordToBase64(TextBox1.Text);
}
protected void Button2_Click(object sender, EventArgs e)
{
Label1.Text = DecodeFrom64(Label1.Text);}
|
|
|
|
|
Are all of these functions in the same class?
|
|
|
|
|
I hope your not uSing this code to "encrypt" anything because this is not encryption.
Get rid of the "static" keyword on the EncodePasswordToBase64 method definition line.
|
|
|
|
|
thanks for the solution 
|
|
|
|
|
hi every one ,
if i have any combobox filled with column in any table (MemeberValue, DataSource, DisplayName)
and i need to change the text of this combo if i know the MemeberValue(ID).
how can i do that ??
|
|
|
|
|
That will depend on what UI you are using, winforms/wpf/silverlight/asp and that is just the common ones.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
When you want to change the text? When _SelectedIndexChanged event fired?
|
|
|
|
|
hello i am writing an that application that can read a pdf file, get values from a pdf file and display in the application. . sofar i cannot retrive it on the pdf controler. please help
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;
namespace WindowsFormsApplication13
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "PDF document (*.pdf)|*.pdf";
DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK)
{
try
{
string pdfFile = dialog.FileName;
//this.axFoxitReaderOCX1.LoadFromFile(javascript.pdf);
}
catch (Exception exe)
{
MessageBox.Show(exe.Message, "Spire.PdfViewer Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
string path = @"C:\users\library\livhuwani\Documents\books.pdf";
System.Diagnostics.Process.Start("", path);
}
}
}
}
}
|
|
|
|
|
So, basically, you haven't done anything?
Start here: Extract Text from PDF in C# (100% .NET)[^] and come back when you have a specific problem - we aren't going to do it all for you!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
livhuone wrote: sofar i cannot retrive it on the pdf controler. please help I'm sorry but you need to give specific details of where in your code the errors occur, and exactly what they are.
|
|
|
|
|
Hello,
I am writing a lengthy list of all of the folders to a List<string>. I am doing that on BackgroundWorker1. I have a second background worker that sleeps for one minute and then starts pulling the information to the list. My problem is that I do not know how to keep the loop going until the List created in the first Background Worker has ended. This is what I have and I know it is wrong.
<pre lang="c#"> private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
System.Threading.Thread.Sleep(60000);
int KeepCounting=0;
listBox1.Invoke((Action)(() => listBox1.Items.Add("Starting Scan : " + DateTime.Now.ToString())));
while (KeepCounting < variables.foldersToSearch.Count)
{
listBox1.Invoke((Action)(() => listBox1.Items.Add(variables.foldersToSearch[KeepCounting])));
KeepCounting++;
toolStripStatusLabel1.Text = " Searched " + KeepCounting.ToString() + " folders.";
}
}</pre>
|
|
|
|
|
The biggest problem with doing what you're doing is that List<t> isn't thread safe. You really shouldn't be trying to Add and Remove items from the List<t> without synchronization in place to avoid nasty little bugs that you're going to have a hell of a time reproducing.
Read:
Quote: Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
It is safe to perform multiple read operations on a List<t>, but issues can occur if the collection is modified while it’s being read. To ensure thread safety, lock the collection during a read or write operation. To enable a collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization. For collections with built-in synchronization, see the classes in the System.Collections.Concurrent namespace. For an inherently thread–safe alternative, see the ImmutableList class.
A better alternative would be to use a ConcurrentQueue<t>[^] instead.
|
|
|
|
|
Hi.
I need a tutorial about how to make a Custom Autoupdater cuz i can do 1 by myself :I
no clickonce pls it ins't customizable
someone can help me plz
|
|
|
|
|
The best way for you to tackle this is for you to start defining your requirements. Saying you want an autoupdater is only the start - you need to break that down. For instance, do you want it to be updated from a local network only, or should it be available via the Internet as well? Does the update process require authentication or a license? You need to get a full list of your desired features, and then you start by breaking each part down into manageable tasks.
|
|
|
|
|
|
GuyThiebaut wrote: Here is some codez 4 U 2 look @:
Are you OK? Did you hit your head on something? How many fingers am I holding up ?
|
|
|
|
|
Beeer!
Cue the music to "Our Tune" from Radio 1...
I confess, I am a reformed teenager, a teenager who could not be arsed to spell correctly.
I get triggered every so often when I see a 'plz' and return to my terrible habits.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
im sorry but english is not my native language so in my language (Spanish) "plz" is usually used so i use it just for bad habit.
im quiet new in c# would you pls give me a list of what do i need to define first before all? cuz right now i just want a updater that update my app via Internet and should be licensed
|
|
|
|
|
Member 10928084 wrote: pls give me a list of what do i need to define first before all? To quote Pete "The best way for you to tackle this is for you to start defining your requirements."
Member 10928084 wrote: i just want a updater that update my app via Internet and should be licensed Sure I get that - I think the article will give you everything you need to create an updater that takes update information off an FTP site on the 'internet'.
I don't know what you mean by "should be licensed".
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|