|
I suggested in my response to your original question that you need to add some proper details to your question. For example, what do you mean by fingerprints of source codes or other format files? And where do you plan to 'upload' these files or fingerprints to?
|
|
|
|
|
I assume that what you are looking to do is to track the unique identities of files so you are wanting to look at things like the file path, the size of the file and a hash of the file contents - at a high level, this is the fingerprint of the file. Then you want to save this information somewhere, so you want to perform the CRUD operations on this information. Is this correct?
|
|
|
|
|
yeah you're true this is small part of my project
my actual project is develop a system for plagiarism detection
|
|
|
|
|
So, you're using this to track files that you've already tested for plagiarism, and not using this as part of the plagiarism detection itself? Basically, you're going to need to build a database of these files that consists of the path, the file length and the hash of the file. The logic works something like this:
- If the path does not exist in the database, you know you're going to need to check it.
- If the path does exist, compare the actual file length against the one you stored in the database. If it differs, you're going to need to check it.
- Assuming you've reached this point, you're going to have to hash the physical file and then compare it against the hash you've stored. Again, if it differs, you're going to need to check the file.
Now, what I would do if I were writing this is assign a Guid at the start of your processing - then when you add a record, or find the record in the database, you'll update it with this Guid. Once you've gone through all your files, the files that are present on your machine will be marked with this Guid in the database. Any files that have been renamed or deleted on the disk will not have this Guid associated, so you can get rid of them from your database.
|
|
|
|
|
|
|
this is small part of my project
my actual project is develop a system for plagiarism detection
|
|
|
|
|
Error Details: No mapping exists from object type System.Web.UI.WebControls.TextBox to a known managed provider native type
Following are the code
protected void btn_save_Click(object sender, EventArgs e)
{
conn.Open();
SqlCommand cmd = new SqlCommand("insert into tbl_reg(name, f_name, m_name, dob, gender, phone, address, class, roll_no, section, user_nm, pswd)", conn);
cmd.Parameters.AddWithValue("@name", txt_nm.Text);
cmd.Parameters.AddWithValue("@f_name", txt_f_nm.Text);
cmd.Parameters.AddWithValue("@m_name", txt_m_nm.Text);
cmd.Parameters.AddWithValue("@dob", txt_dob);
if (rbtn_m.Checked == true)
{
cmd.Parameters.AddWithValue("@gender", rbtn_m.Text);
}
else
{
cmd.Parameters.AddWithValue("@gender", rbtn_f.Text);
}
cmd.Parameters.AddWithValue("@phone", txt_phone.Text);
cmd.Parameters.AddWithValue("@address", txt_address.Text);
cmd.Parameters.AddWithValue("@class", drpdn_class.SelectedValue);
cmd.Parameters.AddWithValue("@roll_no", txt_rollno.Text);
cmd.Parameters.AddWithValue("@section", txt_section.Text);
cmd.Parameters.AddWithValue("@User_nm", txt_user_nm.Text);
cmd.Parameters.AddWithValue("@pswd", txt_pswd.Text);
cmd.ExecuteNonQuery();
conn.Close();
}
|
|
|
|
|
Just a guess, but change this:
cmd.Parameters.AddWithValue("@dob", txt_dob); To this:
cmd.Parameters.AddWithValue("@dob", txt_dob.Text);
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank u so much, its helpfull.
Could u plz give me proper code flow if possible, I'll be thankful.
|
|
|
|
|
Your query is missing the VALUES clause, so the next error you'll get is a SQL syntax error.
INSERT INTO tbl_reg (name, f_name, m_name, dob, gender, phone, address, class, roll_no, section, user_nm, pswd)
VALUES (@name, @f_name, @m_name, @dob, @gender, @phone, @address, @class, @roll_no, @section, @user_nm, @pswd)
You should wrap your connection and command objects in using blocks to ensure that they are properly disposed of when no longer needed.
You're storing the connection as a class-level field, which is a bad idea. It should be a local variable, created as late as possible, and disposed of as soon as possible.
private static SqlConnection CreateConnection()
{
string connectionString = WebConfigurationManager.ConnectionStrings["YourConnectionString"].ConnectionString;
return new SqlConnection(connectionString);
}
...
using (SqlConnection connection = CreateConnection())
using (SqlCommand command = new SqlCommand("...", connection))
{
...
}
You seem to be storing passwords in plain text, which is a very bad idea. You should only ever store a salted hash of the user's password:
Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I have a form in which i have some functionalities in form_keyup event.
This event is not getting triggered if the key has been released when the message box has been displayed.
|
|
|
|
|
There's a problem with your code.
Since we can't see your code, we can't tell you what the problem is.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
What key actions do you want to intercept when a MessageBox is showing: only a few, perhaps like the Enter Key being pressed ... or, all key events ?
We need to know what you are doing now in code to get the Key up/down or press/release event. Show us the relevant code (but, not all your code !).
Is the Form in which you want to monitor keystrokes the Main Form of a WinForm Application ?
If you are using a MessageBox in WinForms, it is displayed modal, and it blocks the UI thread, so key events are not routed to the Form/Context that showed it.
It is not standard practice to allow key-entry in a MessageBox except for system-defined keys that have certain standard side-effects (like press 'Enter and you get the default MessageBoxButton 'clicked).
Depending on the information you provide, there may be several choices including using another Form, or a UserControl, shown modal, or more complex technique involving P/Invoke to WinAPI calls, or setting an Application Key Global Hook.
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
modified 2-Nov-15 10:41am.
|
|
|
|
|
This is my code. what should i do if i want to make word in table center.
protected void ButtonCreatePDF_Click(object sender, EventArgs e)
{
var doc = new Document(PageSize.A4);
doc.SetPageSize(iTextSharp.text.PageSize.A4.Rotate());
var output = new MemoryStream();
var writer = PdfWriter.GetInstance(doc, output);
doc.Open();
var titleFont = FontFactory.GetFont("Algerian", 35 );
var actionFont = FontFactory.GetFont("Comic Sans MS", 15);
var recipientFont = FontFactory.GetFont("Lucida Calligraphy", 25);
var reasonFont = FontFactory.GetFont("Comic Sans MS", 15);
var dateFont = FontFactory.GetFont("Lucida Calligraphy", 25);
var certDetailTable = new PdfPTable(1);
certDetailTable.HorizontalAlignment = Element.ALIGN_MIDDLE;
certDetailTable.SpacingAfter = 0;
certDetailTable.SpacingBefore = 0;
certDetailTable.DefaultCell.Border = 0;
certDetailTable.AddCell(new Phrase(TextBoxTITLE.Text, titleFont));
certDetailTable.AddCell(new Phrase(TextBoxACTION.Text, actionFont));
certDetailTable.AddCell(new Phrase(TextBoxRECIPIENT.Text, recipientFont));
certDetailTable.AddCell(new Phrase(TextBoxREASON.Text, reasonFont));
certDetailTable.AddCell(new Phrase(TextBoxDATE.Text, dateFont));
doc.Add(certDetailTable);
doc.Close();
Response.ContentType = "application/pdf";
Response.BinaryWrite(output.ToArray());
}
|
|
|
|
|
You need to create the Cell, set its horizontal alignment property to ALIGN_CENTER, then add the Cell; see: [^], [^].
There's a free book on ITextSharp available: [^].
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
CERTIFICATE OF ARCHIVEMENT
Presented To
Recipient Name
For Outstanding Archivement
Day/Month/Year
now, my pdf document contain all above word. the location of word is at left page. but i want to make those word located at the center of document.
|
|
|
|
|
Hi,
I want to download a csv file in a button click and send back to the control to another page. I have a page a.aspx where i need to download the csv. Once i download the csv the b.aspx should be loaded. i am getting an exception cannot redirect after http headers have been sent
My code is
ponse.ClearContent();
Response.ContentType = "application/text";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.Charset = "";
string sep = "";
for (int i = 0; i <= dtsorted.Columns.Count - 1; i++)
{
Response.Write(sep + dtsorted.Columns[i].ColumnName + ',');
}
Response.Write("\r\n");
for (int i = 0; i < dtsorted.Rows.Count; i++)
{
sep = "";
for (int j = 0; j <= dtsorted.Columns.Count - 1; j++)
{
Response.Write(sep + dtsorted.Rows[i].ItemArray[j].ToString() + ',');
}
Response.Write("\r\n");
}
Response.SuppressContent = true;
Response.Redirect("VerifyLPODetails.aspx", true);
if (!Response.IsRequestBeingRedirected)
{
Response.Redirect("VerifyLPODetails.aspx", true);
}
|
|
|
|
|
One request will generate one response. That response will either be a file, such as an HTML page or a CSV file, or a redirection to another page.
You can't return both a file and a redirection in the same response.
Add some javascript code to open a new window pointing to a handler which creates and returned the CSV file. After opening the window, the javascript code should then load the new page in the current window.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i will make a new software
but can i anyway make a code when i make in my speak a longer brake, he shot place a point, if i say make a new line the application schould write in a new line
|
|
|
|
|
Sure you can, but I think, for your initial prototype, you should consider trying to use specific commands, rather than looking for pauses of greater than a certain length to trigger an action. I'd choose some special word to serve as a "trigger:" to indicate that the word that follows the trigger is parsed as a "command."
For example: trigger : "Parse"
Parse return // append period followed by cr/lf pair
Parse newline // append cr/lf pair
Start by getting oriented about the speech-recognition library Microsoft provides: [^].
The good news for you is that CodeProject has many excellent articles that will help you get started with your application: [^].
And, don't forget to read the tutorials by Microsoft on speech-recognition.
Once you have your project in progress, as you have specific problems, or questions, do come back here (or use the QA forum) to post your questions including selected pieces of your code directly related to the issue/problem.
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
I suggest you to read about "Project Oxford" from Microsoft. It exposes web API for speech recognition and supports NLU
|
|
|
|
|
How do you be gritty in c # webbrowser to support Windows Media Player
|
|
|
|
|
Eh? What do you mean by gritty? I'm sorry but your question makes no sense in this form.
|
|
|
|
|