|
the contain, first import the file then direct encrypt without saving, second the same input the file (ciphertext) direct the button to decryption which become is the save not include the type of file etc: .txt, .mp3, .mpg, .jpg. thanks
|
|
|
|
|
So is all you need the filename without the extension? Because that's trivial...
string fn = Path.Combine(Path.GetDirectoryName(sourceFile), Path.GetFileNameWithoutExtension(sourceFile));
If not, could you please give an example of what you do want, because I can't understand 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 – ∞)
|
|
|
|
|
Thanks for this source, very help in me
|
|
|
|
|
You're welcome!
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, the main class has separate to the second RC5 class
|
|
|
|
|
I took his first two posts as he was saying as he was trying to find the original key to an encrypted file.
|
|
|
|
|
Is it possible to get the machine name of the SQL box that executed a stored proc in a load balanced environment? I know I can modify all the stored proc to return @@servername somehow (i.e. optional output param), but trying to do it the least painful way possible.
|
|
|
|
|
We have a ModifiedBy field on every table to nail the user to the latest data, it would be trivial to add another field and grab the servername. Id the DB is too large you cold use a trigger spit to update the field. Great Ghu, I've recommended triggers spit twice today I feel dirty.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Implementing a canvas with draw objects circle and Square and a connectivity line between the Draw objects. Dynamically placing the symbols on canvas and connecting with line connector. But i need the connecting line should drag,if i move the object on canvas.
Advice me, how i can do this and please provide any links.
Thanks & Regards,
Krishna Royal
|
|
|
|
|
What have you done so far? Any answer to this depends on what the canvas control is and how the objects to connect are represented.
|
|
|
|
|
Hi,
I am trying to connect from C# WinForm application to MySQL but getting the above error.
MySQL is on CentOS and I am connected through NaviCat without any problem with enabling SSH Tuning option in NaviCat.
here is my code in C#:
sql_connection = new MySqlConnection(xmlClass.get_connectionstring("BizCards\\BizCards"));
sql_connection.Open();
sql_command = new MySqlCommand("sp_populate_countries", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_adapter = new MySqlDataAdapter();
sql_adapter.SelectCommand = sql_command;
data_set = new DataSet();
sql_adapter.Fill(data_set, "countries");
DataViewManager dataview_manager = new DataViewManager(data_set);
DataView main_dataview = dataview_manager.CreateDataView(data_set.Tables["countries"]);
cboCountry.Properties.ValueMember = "country_code_alpha2";
cboCountry.Properties.DisplayMember = "country_name";
cboCountry.Properties.DataSource = main_dataview;
cboCountry.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("country_name", 50, "country_name"));
cboCountry.Properties.ShowHeader = false;
cboCountry.Properties.PopupSizeable = false;
cboCountry.Properties.ShowFooter = false;
cboCountry.Properties.PopupWidth = 50;
Technology News @ www.JassimRahma.com
|
|
|
|
|
What does your connection string look like?
|
|
|
|
|
server=xx;port=xx;database=xx;uid=xx;pwd=xx;connection timeout=xx
Technology News @ www.JassimRahma.com
|
|
|
|
|
Is MySQL configured to allow connections from your client computer?
Can you connect with some MySQL GUI tools?
|
|
|
|
|
it's allowed. otherwise I won't be able to connect using NaviCat
Technology News @ www.JassimRahma.com
|
|
|
|
|
Also posted in the database-forum.
Are you new here?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am trying to create some classes that act like a string, but allow me to test the type at a later date. Because string and String are sealed, I can't seem to inherit from them. I also found out you can't override the assignment operator. I found something close to what I want here on stackoverflow, but it uses structs which can't be inherited. Here's a example of what I want to do, but I can't figure out how:
public class ORSerialLotNumber : string {}
public class SerialNumber : ORSerialLotNumber {}
public class LotNumber : ORSerialLotNumber {}
List<ORSerialLotNumber> mySLNList = new List<ORSerialLotNumber>();
SerialNumber sNum1 = "Sd-23s-3sf";
LotNumber nNum1 = "2342434";
mySLNList.Add(sNum1);
mySLNList.Add(nNum1);
foreach(var v in mySLNList)
if(v.GetType() == typeof(SerialNumber))
string serial = v;
if(v.GetType() == typeof(LotNumber))
string lot = v;
|
|
|
|
|
That example doesn't really depend on it being a struct, it's about the implicit conversion operator.
Here's a minimal implementation of a class to implicitly converts to and from string:
class CustomString
{
public static implicit operator CustomString(string s)
{
return new CustomString();
}
public static implicit operator string(CustomString s)
{
return "";
}
}
Do that for both subclasses.
By the way, as far as I can tell you should be able to use is[^] instead of the GetType() == typeof() "not-quite-anti-pattern-but-close".
|
|
|
|
|
Thanks, this seems to be just what I need, though I imagine that I need to save the actual string value and have the constructor set that value and the operator string(CustomString s) return the string instead of an empty string?
class CustomString
{
private string _value;
private CustomString(string s)
{
_value = s;
}
public static implicit operator CustomString(string s)
{
return new CustomString(s);
}
public static implicit operator string(CustomString s)
{
return s._value;
}
}
Would I also be able to implement INotifyPropertyChanged with this class? I don't see how as there's no public property. Would I just use "_value" even though it's private?
|
|
|
|
|
You could just give it a public property though, right?
|
|
|
|
|
There wouldn't be a whole lot of point in implementing the interface if he doesn't!
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 – ∞)
|
|
|
|
|
So the idea would be to include a public property, but still have the implicit operator act on that property? Would that then allow someone to either use the implicit operator or the property directly?
|
|
|
|
|
Yes, is it giving you any trouble?
|
|
|
|
|
No, I just didn't even think about this, or even know that it was possible. I'm reading more about `implicit`, which seems very useful. It doesn't seem to be touched on in most 'beginner' reading, though.
|
|
|
|