|
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.
|
|
|
|
|
First, is this WinForms, WPF, ASP.NET ?
"True Grits" starts when you put your fingers on the computer keyboard and search CodeProject, the web, and StackOverFlow.
First, you must deal with the question of whether grits can be found and used in the way you describe. You might run into a problem like the one described here: [^], where the versions of Windows and/or WMP are incompatible.
Once you know that grits is available, you harvest the raw grits by reading the relevant links in your search results, and/or studying relevant code you discover in the links.
For the raw grits to be useful, it needs to get ripe. So you create a WinForms or WPF project, you put a web-browser control on it, you do what it takes to get the Windows Media Player object loaded (an HTML file opened) in that WebBrowser control, and the right connections made to a valid media source, and the play command issues.
... and you ask specific question here describing any problem(s) you are having, showing the relevant code in your project as necessary.
«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 1-Nov-15 4:06am.
|
|
|
|
|
BillWoodruff wrote: For the raw grit to be useful, it needs to get ripe.
Unfortunately, raw grit is like supermarket fruit: you can wait forever for it to ripen to luscious edibility only to find that 30 seconds later it has gone off and is inedible...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Well, OG, down in the American south where I came from, grit, as in grits, is an all-white meal/flour made from maize (boiled corn) that has about zero nutritional value, and is pretty much tasteless, which is why it's probably so popular as part of breakfast. Almost all American grits nowadays is made from alkali treated corn (i.e., technically it's a form of hominy).
Grits is the official prepared food of the state of Georgia in the U.S.
Typically served with loads of butter, salt, pepper, increasing its value in promoting heart-attack, stroke, obesity, arterial congestion, etc. It is often deep-fried into patties in oil (preferably slightly rancid left-over bacon-grease) to round out its toxicity with some saturated-fats.
I suspect you English boys think of grit in terms of nail-files, sand-paper, or macadam, or some other esoteric use.
It is true, for American grits, that if they are not in a tightly sealed container they will get infested with something insectoid pronto.
cheers, Bill
«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.
|
|
|
|
|