|
dsshiny wrote: Is it possible to digitally sign a PDF file using USB token through C# program? It's possible to sign a PDF using a certificate, and yes, that can be built with C#. What USB-token? If that's what contains the certificate, then you'd be writing some additional code to read from it.
dsshiny wrote: If yes, please give me sample code .. There's quite some examples on digitally signing a PDF. I suggest you start there
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi Eddy Vluggen,
thank u for your quick reply..
In my question, i mentioned 'USB Token' for the USB device/Smart card in which the certificate contains..
i tried many sample code . But i didnt get the output..
please help me to find the solution
|
|
|
|
|
Hello again Code Project!
Here is the deal, I have two separate functions called InputData and DisplayPlayerData. Each of these functions have loops inside of them. The loop in InputData is supposed to get player's name and player's score, breaking the loop with a sentinel and not to exceed 100 players. No problem.
The other function, DisplayPlayerData, has a loop to display the name and score of each player.
I am thinking that I could use a state controlled while loop. What I really need to know is how to bring the input data from the first function into the second function. Would this function look like public static void DisplayPlayerData(){} or do I need to declare a few variable in the ()?
|
|
|
|
|
Are you working in WinForms, or WPF here, or ... ?
Is there a strong organic reason you want to separate out the entry process for players' names and score from the task of displaying them (in a list ? a grid ? a textbox ?) ?
A little more detail about your goals here, please.
~
“This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
|
|
|
|
|
Do it using Lambda expressions. You dont have to create two separate functions for that.
Everything you want will be done in just two or three lines of code.
Even you can do it without any "for" or "while" loop
Regards,
CodeBlack
|
|
|
|
|
Hi ,
when page load I am downloading the report pdf from ssrs and storing it in my local successfully , question is when I load the page I need to attach the same file into the textbox.text.
ex : same like it shows in the outlook attachment. Please help me , it should be in C#/Jquery/Ajax .
Note : we are not using the upload control
please reply answer to this or send to my mail id rpaulvincent@gmail.com
thanks
R.V.Paul
|
|
|
|
|
when page load I am downloading the report pdf from ssrs and storing it in my local successfully , question is when I load the page I need to attach the same file into the textbox.text.
You want to attach file or you want to display path of the file in textbox ?
Get the path of the file when you create report. and set it as a textbox's text.
simple.
when you need to upload it or attach it with email use the same path.
Hope this will help.
Regards,
CodeBlack
|
|
|
|
|
Does Application.Run((new Form1()); in Program.cs load on the Stack or Heap? I am asking to see if all methods inside the Form1 code are methods that go on the Stack or Heap.
Also, if I create a new Form object from Form1 - does it load on the Stack or Heap?
What about methods processed inside of new objects. Example:
public partial class Form1 : Form
{
public Form1()
{
Doofus d = new Doofus();
}
}
public class Doofus
{
Doofus()
{
createsomething();
}
void createsomething()
{
string a = "whiskey";
}
}
In this, does d's createsomething() method go on the stack or the heap?
I have read several articles on this, and I have "googled it myself". I'd just like a straightforward answer if anyone knows.
Thank you
modified 13-Aug-13 11:06am.
|
|
|
|
|
Methods do neither, they are loaded into the code section of the application's memory on startup. Objects are generally created on the heap and values and temporary variables on the stack. Form1 will be created on the heap, as will (generally) all its components.
Use the best guess
|
|
|
|
|
Looking at some of your other questions, I would strongly recommend .NET Book Zero[^].
Use the best guess
|
|
|
|
|
|
Objects are created on heap; and Application.Run is creating the object Form1 as new Form1(); so it will be created on heap. As, per my understanding, createsomething() will also go on heap as it is part of an object. But better look for memory allocation in .Net and you will have a clear idea about what goes on stack and what goes on heap.
|
|
|
|
|
I have a windows service starting and running fine on Windows 7, but when I try to start it on Windows Server 2003 after 30 seconds a message pops up, saying "windows service did not respond to the start or control request in a timely fashion". Tried to start it as local service, local system or local admin to no avail.
Don't know if it is important, but it is c# code an uses enterprise library 5.
The OnStart()-Methode only logs through entlib and starts a timer, should only take milliseconds and it work on win7.
Any idea??
|
|
|
|
|
The code is crashing for some reason. Look in the Application Event Log for any clues and you'll probably have to instrument your code to log everything that goes on during OnStart.
|
|
|
|
|
No, it's not, the application log only contains one entry with error code 1053. The program can also be started in console mode by running from a command line with an additional parameter: program starts, runs, finishes, not error.
|
|
|
|
|
Again, instrument your code so that it logs what it's doing and what values are being used at key points.
|
|
|
|
|
It appears as if just that is not happening, I mean the code is not called at all. First thing OnStart() does is write a log entry. Works fine on win 7, does not happen on the server machine. Made the app.config invalid, application log say so, app.config correct, no exception in app log.
|
|
|
|
|
You haven't posted the code in OnStart so there really isn't anything anyone can tell you. There simply isn't enough information to work with.
|
|
|
|
|
Here it is:
protected override void OnStart(string[] args)
{
}
Please notice, everything is commented out, on startup I get the error 1053.
I don't see anything wrong with the code, since it runs fine on other machines.
|
|
|
|
|
Still not enough information. What's the constructor of this class look like?? What happens in OnStop that you're calling?
There are various things that can go wrong with this. Even a difference between compiling Debug instead of Release.
Try this[^] list of issues.
|
|
|
|
|
Have you checked whether the enterprise library 5 and the correct .NET Framework version are installed on the target machines? Does it perhaps use an advanced feature/function that is not available under Windows Server 2003?
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
I can run the program in a console mode by attaching a command line parameter; it starts, runs, finishes without error. It feels more like a windows setup problem.
|
|
|
|
|
I might be misunderstanding your question but the OnStart method must exit within a limited period of time. I recall it was about a minute or so otherwise you get that error message. Are you sure that what you're doing really is completing in time. Like Dave K suggests, you need messages to help trace where it might be snagging.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
|