|
Try this:
http://support.microsoft.com/?id=307010
I believe the error being thrown is because the File.Encrypt(filename) method is using the global encryption scheme for your user account on your installation/set up of windows. For e.g. if you decide to encrypt a physical harddrive or parition on yoru computer a key is generated based on yoru user account. So no-one else can plug your HD into their computer and promptly decrypt its contents. If you do encrypt your HD or folders/files this way it is suggested that you enable the recovery manager in case you lose your login details of which as i understand it is like another user login.
So since you either do not have Encryption enabled or the certificate has expired you are recieving that error. I could well be way off track but i think it has to do with this.
Try that article by MS detailed above. If not just decide what level of security you need and generate your own encryption scheme based on some key you think up.
Darren
|
|
|
|
|
I have problem in C# windows development. For successfull exection of my program I need to refer few DLLs that we have developed. I am able to refer the DLLs in my system and I am able to run the code. But If I copy this DLL to some other systems the reference not exists, even the DLLs are existing in the same directory Hierarchy. I have opened my project file in notepad and checked and I observed that <hint path=""> is missing in those files. Can any body help me to point out what is the problem.
Dinesh Kumar P
|
|
|
|
|
Try to set the all reference properties of "Copy Local" to true. Then you can just copy your DLL to other system.
The problem is probably : your codes are using some DLL from Global Assembly Cache not directly from directory.
|
|
|
|
|
Hi,
I have a image on a MemoryStream and a WebBrowser Control. How can I load this image to the webbrowser control without saving it to hard disk!
Thanks,
Hung
|
|
|
|
|
Hi,
Does anyone now hot to get the name of the network group that I'm curretnly in. "Environment.UserDomainName" works only if the network is with a domain.
Thanks in advance
Plamen
|
|
|
|
|
See this : http://www.codeproject.com/csharp/host_info_within_network.asp?df=100&forumid=146669&exp=0&select=1349731
|
|
|
|
|
I would like to read the content of DataGrid after being updated particular or all rows. But I can read current row only. How to read all rows?.
The code i am using to read current row... DataGrid name - DGField
BindingManagerBase BMB = DGField.BindingContextDGField.DataSource,DGField.DataMember];
DataRow Dr = ((DataRowView) BMB.Current).Row;
MessageBox.show(Dr[0].ToString());
Jey
|
|
|
|
|
You can access one cell of the grid as :
DGField[rowIndex,ColumnIndex]
bye
|
|
|
|
|
hi..
In my application im taking input as a string from user, which is acutually a color name..now is there any way to validate that string wheather it is a valid color or not ?
For ex.
"RED" its a valid color
"REDD" its not a valid color
any help..
Thanks
|
|
|
|
|
You need something to validate it against, what colors are valid? The C# Color class contained ones? or the names of Colors in English?
|
|
|
|
|
Use the Color.FromName method to convert the string to a color. If the name is invalid, the ToArgb property of the color returns zero.
---
b { font-weight: normal; }
|
|
|
|
|
If treelist have open node, and i add new node to treelist - new node not can have focus.
treelist.AllNodesCount = all nodes in treelist - 1 ???
But if all node is close, and i add new node - !!! my new node can have focus!!!
treelist.AllNodesCount = all nodes in treelist !
My code:
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Nodes;
namespace video
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
TLNode tln1 = new TLNode(1, treeList1.Nodes, "dfhdfhgdf", "234523");
treeList1.Nodes.Add(tln1);
treeList1.FocusedNode = tln1;
}
private void simpleButton2_Click(object sender, EventArgs e)
{
TLNode tln1 = new TLNode(1, treeList1.Nodes, "4567rtyu4567", "ertye3456ertye");
tln1.HasChildren = true;
TLNode tln_children = new TLNode(2, tln1.Nodes, "trtr3636yryr", "6868cncn2525");
tln1.Nodes.Add(tln_children);
treeList1.Nodes.Add(tln1);
}
}
public class TLNode: TreeListNode
{
string name;
string url;
public TLNode(int id, TreeListNodes owner, string name_, string url_) : base(id, owner)
{
name = name_;
url = url_;
}
public override void SetValue(object columnID, object val)
{
}
public override object GetValue(object columnID)
{
return "text";
}
}
}
How to do this problem?
Help me please.
|
|
|
|
|
Dima Filipiuk wrote: using DevExpress.XtraTreeList
Ask them 1st! Then if you have no luck, tell us about your pain, and then repaste the original question.
|
|
|
|
|
Hi!
In my project I have a server creating a singleton that answers requests from various clients. Sometimes I need the singleton to delay requests from specific clients while not blocking requests from the others.
Currently Im using a 'while' loop checking for a flag that tells me if the request should wait or be answered but this has the side effect of not allowing any other request to go through until the current one completes.
SingleCall won't work since I need to store status between calls. Using a singleCall object to call the singleton could work but seems ugly.
Any ideas are welcome! Thx!
|
|
|
|
|
Depending on the amount of client queries and also the timeout. Cant you buffer valid client requests in a queue?. Possibly have two threads, one to constantly listen for client queries and validate if the request should go through... then passing this to the Syncronized Queue while the Singleton deals with the current request?
Or do you need the Singleton object to validate the request itself? Again depending on the amount of queries just queue them up in a buffer ready to pass to the singeton. As long as you can clear the buffer before the clients timeout and send a new request it should be fine.
Or what if you notify the client you have recieved the respone and it is in a queue, possibly have a thread periodically reply to the client with ist position.
Darren
|
|
|
|
|
Hum... wouldn't the listening thread block on the first request it should delay?
The idea is that some requests should wait for a flag/event/something before the remote call returns, the problem is that until the current remote call returns the Singleton won't process any others effectively blocking the server on the current call.
As I said, it can probably be done with two objects, a Singleton and a SingleCall (if the SingleCall creates a new instance for each request) where the SingleCall would block (until it got a signal to continue) and not the Singleton. This would imply twice the remote calls and since the SingleCall has no status, a way to read the flag to continue (if only I could send an object reference to the SingleCall...)
There must be an easier way to do this...
|
|
|
|
|
Who can tell me aboat retrieving the H.D.D serial number in C#?
|
|
|
|
|
http://www.codeproject.com/csharp/hard_disk_serialno.asp?df=100&forumid=33442&exp=0&select=939821
|
|
|
|
|
|
Hi all,
i'm running this shellcontrol...
TempPath = "C:\Program Files\Progressive projects\Progress\ReportTemplates"
TempName = "ClientRecordCardHairFo-Pdf.xsl"
public void shellControl2()
{
if(CustCd != "")
{
string command = "\"" + Convert.ToString(TempPath) + "\\fop.bat" + "\" " + "-xml " + "\"" + Convert.ToString(TempPath) + "\\ClientRecordCard.xml" + "\" " + "-xsl " + "\"" + Convert.ToString(TempPath) + "\\" + Convert.ToString(TempName) + ".xsl" + "\" " + "-pdf " + "\"" + Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.Pdf" + "\"";
ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
// /c switch sends a command
startInfo.Arguments = Convert.ToString(command);
// redirect messages to this program
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
//don't execute using shellexecute API
startInfo.UseShellExecute = false;
//Don't open command prompt window
startInfo.CreateNoWindow = true;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
if (output.Length != 0)
shellControl1.WriteText(output);
else if (error.Length != 0)
shellControl1.WriteText(error);
}
}
Thing is,it stops when it gets to: string output = p.StandardOtput.ReadToEnd();
It doesn't give me an error though. It's realy frustrating
plz help...
He who laughs last...
|
|
|
|
|
This text 'ReadToEnd assumes that the stream knows when it has reached an end. For interactive protocols, in which the server sends data only when you ask for it and does not close the connection, ReadToEnd might block indefinitely and should be avoided.' was taken from MSDN link here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemIOStreamReaderClassReadToEndTopic.asp[^] it seems like your program is waiting on a termination.
I am not 100% on your code, i know your trying to redirect the response or messages through your program but what if there are none? Maybe you should run the command and have a listener on a seperate thread.
Darren
|
|
|
|
|
So am understanding you correctly,
the program is waiting for the comand prompt to close but it's stuck trying to sen me an output?
He who laughs last...
|
|
|
|
|
i found the problem...
The part where i say:
startInfo.Arguments = Convert.ToString(command);
it gets sent to the command prompt but its not seen as a command and thus does not create an output for me and is stuck waiting.
it should be
startInfo.Arguments ="/C " + Convert.ToString(command);
This switch is for when you send a command.
thank you for putting me in the right direction.
He who laughs last...
|
|
|
|
|
Excellent, glad you fixed it
|
|
|
|
|
What means "Apartment" in C#?
|
|
|
|