|
Whatever you mean by "data recovery", it isn't simple job. You'll need to know how to access to different file systems to be able to recover a piece of data. The best results is when you know how to access to raw data (no matter of file system).
See: Data recovery - Wikipedia
|
|
|
|
|
Message Closed
modified 22-Feb-18 15:55pm.
|
|
|
|
|
Member 13685821 wrote: i need coding for c# to make recovery software
Well then you'd better get crackin'. Software doesn't write itself, you know!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Then you have to study and understand how both these filesystems are organized, and begin to code with these understandings.
I would add that C# may not be the best choice for this task, since it adds several layers of abstractions between the code and the core I/O operations that you would need. And, finally, this is far from a trivial task; if you have to ask this on a public forum, you are probably not fit yet for this.
"I'm neither for nor against, on the contrary." John Middle
|
|
|
|
|
"Recovery" implies a "backup" was created in the first place.
Do you have a backup procedure?
Or is this another "PC Cleaner"? (i.e. doesn't really do anything)
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
First off, NOBODY is just going to hand you a quite large piece of code to do this.
Second, if you're even asking this question, you're not yet qualified to even attempt it.
You MUST understand how the various file systems work, how they are organized both logically and on disk, the various types of partition tables, how they work, the various disk structures, what actually happens when you do any operation to a file or to the file system itself, what can go wrong with them, how to handle cases where a file system maintains backups of it structures, ...
Yeah, you've got about a years worth of homework to do, maybe more, before you even attempt to write something like this.
Oh, and you're not going to write it in C#. A much better language would be C so you can run the app without a dependency on a working O/S and a rather large runtime environment.
|
|
|
|
|
How to get an answer to your question
Be specific!
Don't ask "can someone send me the code to create an application that does 'X'.
Pinpoint exactly what it is you need help with.
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
Hi Team,
DateTimePicker control has the below menu options on Mouse Right Click :
Cut
Copy
Paste
No Date/Time
We can select any of this from the menu
Can anyone let me know how can i trigger this clicked events ?
Tried below code:
private void dateTimePicker_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
}
}
Thanks
Sharan
|
|
|
|
|
This Behaviour didn't come from the Control - it comes from the ContextMenu you have assigned to the Control - so you have to look for the Events of this ...
|
|
|
|
|
Hell everyone when i try to insert data through the c# windows application i got "InvalidOperationException" below i have attached my codings can any one help me?
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.Data.SqlClient;
using System.Data.Sql;
namespace WindowsFormsApplication1
{
public partial class frmBook : Form
{
SqlConnection con;
SqlCommand cmd;
SqlDataReader dr;
public frmBook()
{
InitializeComponent();
}
private void lblStaffDetails_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void btnMainmenu_Click(object sender, EventArgs e)
{
this.Hide();
frmMainmenu op = new frmMainmenu();
op.Show();
}
private void dGridBook_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void frmBook_Load(object sender, EventArgs e)
{
this.tblBookTableAdapter.Fill(this.dbLibraryDataSet.tblBook);
this.tblBookTableAdapter.Fill(this.dbLibraryDataSet.tblBook);
con = new SqlConnection();
cmd = new SqlCommand();
cmd.Connection = con;
}
private void btnSaveBook_Click(object sender, EventArgs e)
{
con.Open();
cmd.CommandText = "insert into tblBook (Book_ID, Name, Authour, Category, Donater_ID, Section_ID) values ('" + txtBoxBookId.Text + "', '" + txtBoxBookName.Text + "', '" + txtBoxAuthour.Text + "', '" + txtBoxCategory.Text + "', '" + txtBoxDonaterId.Text + "', '" + txtBoxSecId.Text + "')";
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record is inserted", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void tblBookBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.tblBookBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.dbLibraryDataSet);
}
}
}
|
|
|
|
|
Two obvious errors that I can see:
1. You are risking the integrity of your database by using string concatenation for your queries.
2. You create a new form in btnMainmenu_Click , but then lose it as its reference goes out of scope.
I suggest you fix those two problems first, and then see what happens.
|
|
|
|
|
You create a Sql-connection without ever setting the connection-string. Add a con.ConnectionString = "blablabla" before opening the connection.
Member 13683765 wrote: cmd.CommandText = "insert into tblBook (Book_ID, Name, Authour, Category, Donater_ID, Section_ID) values ('" + txtBoxBookId.Text + "', '" + txtBoxBookName.Text + "', '" + txtBoxAuthour.Text + "', '" + txtBoxCategory.Text + "', '" + txtBoxDonaterId.Text + "', '" + txtBoxSecId.Text + "')"; That's an abomination. It is unsafe as mentioned by Richard, due to SQL-injection. It is hard to update when adding a column and it will become a annoying thing to read if the string becomes long enough that you have to scroll in the IDE.
try
{
string MyConnectionStringHere = "";
using (var con = new SqlConnection(MyConnectionStringHere))
using (var cmd = con.CreateCommand())
{
con.Open();
cmd.CommandText = @"
INSERT INTO tblBook (
Book_ID,
Name,
Authour,
Category,
Donater_ID,
Section_ID
) VALUES (
@Book_ID,
@Name,
@Authour,
@Category,
@Donater_ID,
@Section_ID)";
cmd.Parameters.AddWithValue("@Book_ID", txtBoxBookId.Text);
cmd.Parameters.AddWithValue("@Name", txtBoxBookName.Text);
cmd.Parameters.AddWithValue("@Authour", txtBoxAuthour.Text);
cmd.Parameters.AddWithValue("@Category", txtBoxCategory.Text);
cmd.Parameters.AddWithValue("@Donater_ID", txtBoxDonaterId.Text);
cmd.Parameters.AddWithValue("@Section_ID", txtBoxSecId.Text);
if (1 == cmd.ExecuteNonQuery())
{
}
else
{
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
A few notes;
- You'll still need to set a connection-string in the example, but you don't need SqlConnections in multiple methods, or as a member-variable. It will be closed when exiting the "using" statement.
- You want the complete exception-text; it will tell you where and more.
- Those column-names using up many lines may seem excessive to you; go stand on such a line in the IDE and press Ctrl-X. Move the cursor down two strokes and press Ctrl-V.
Good luck
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
What is the difference between unit tests, integration tests, acceptance tests, functional tests and regression tests?
|
|
|
|
|
|
They test different things; like a tire-test, a motor-test and a customer-satisfaction-survey to a car-salesman.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Up-voted for possible mix of analogy and irony.
I fear the OP here may be headed for an emissions-test fail in the job interview.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
You think he'll blow it? Exhausting
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Until you put in some effort to educate yourself by doing some basic research, there will be no difference.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
How to create sale invoice and print using datagridview values in c# windows applications.
Please help me to find out this solution. Thanks.
|
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
And so far, we have no idea of what you have tried, where you are stuck, or what help you might need.
Since we aren't in the business of doing all your work for free, we aren't going to guess and write you a complete app!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I'm not "brand new" to C# and so I'm still struggling with some concepts. All of the projects I've created so far have a Globals.cs class. It's a class without a namespace and so I use it to hold just a few configuration settings that I want to apply to every file in my project.
I've recently been told that I should NEVER use what he called, top level properties. They aren't read only so they can't be considered constants.
Is there a better way to handle this?
Maybe it's common practice to handle this with a config class?
Maybe I should be using abstraction?
Any advice would be awesome
Thanks for your help!
The lack of surety in programming is part of the reason software is fragile.
|
|
|
|
|
That had a few things I have no idea about
I did not know you could even create a class without a namespace
What is a top level property google did not help!
What would you want to apply to EVERY (presumably .cs) file in a project.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Some folks hate static anything; some folks hate the idea of a Class "floating" outside any NameSpace; pundits rail against both as "violations" of OOP.
.Net itself often glues a bunch of static methods in a Type definition, like with 'String.
But, fact is: .NET C# provides a facility to allow a Class to be declared outside any user-defined NameSpace and used as a repository accessible to all app entities (when declared 'static, of course). This "floating Class" will exist in the Global Application NameSpace.
Whether you should use this facility should be, imho, a result of your choice based on your knowledge of .NET facilities for saving state of the app, of the app's controls, of the data the app manages. And, possible threading issues if the app is multi-user.Rick_Bishop wrote: They aren't read only you can make its contents read-only:
using System;
using System.IO;
public static class Globals
{
public const Int32 MaxFormWidth = 1000;
public static String SerializeFileName { set; get; } = @"Data.xml";
static readonly String SerializeFolderPath = @"MyAppSavedData";
public static string GetSerializeFilePath(string filename = "")
{
if (filename != "" && SerializeFileName != filename)
{
SerializeFileName = filename;
}
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
path = Path.Combine(path, SerializeFolderPath, SerializeFileName);
if(IsValidPath(path)) return path;
throw new FileLoadException($"{path} is not a valid file path");
}
static bool IsValidPath(string path)
{
}
} 'MaxFormWidth is readonly, 'SerializeFileName is read/write, 'SerializeFolderPath is read-only.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
modified 19-Feb-18 3:45am.
|
|
|
|
|