|
There probably should be some componentes that allow you to do this easily, but since I don't know about any of them, I'll give you two ideas:
1. Install something like PDFCreator or CutePDF, and then from C# print to one of the PDF pseudo-printers as if you were printing to a regular printer. This will generate a prompt for the filename at runtime (and require an installation on the client), but depending on your particular circumstances it might or might not be acceptable.
2. Use fyiReporting[^], which I just learned about it. It's a reporting control that can output to a variety of formats, including PDF.
Both ideas are free.
You could also try Google[^] and find a lot of results
|
|
|
|
|
HI,
I need to control office excel document in run time.
The problem is that i don't know the office version that install on the target machine ( can be office 2007 or office 2003 ) and I don't know if and how to set the iterope to the office object in run time.
Thanks for the help.
|
|
|
|
|
I'm developing a new application C#, before some days i came to know about the reflector tool, so, i download this from http://www.aisto.com/roeder/dotnet/ afterwards i use it, it'll show all the exact class, method and code. But i want to know how to write the secure code against reflector tool. I mean i don't want to show my code in reflector tool, then how to protect my code against reflector too
|
|
|
|
|
That's the way .NET is. Since it is only bytecode and not native, it can be decompiled by Reflector.
Try googling for a code obfusctor[^] to find alternatives that will rename your methods and variables, so at least it is much more difficult to understand. This option might be expensive, tough.
|
|
|
|
|
You probably are looking for an obfuscator. See, for instance, this page [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Code is never secure. But for the best results, try Mono's full static compilation or the Remotesoft obfuscator. I don't know of any obfuscator that actually works, but they may exist.
|
|
|
|
|
Write it in C++
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
.NET Reactor[^] is best way to protect your applications
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
hi,
Can some one please help me with articles that would assist me in developing a website for virtual stock market.
|
|
|
|
|
Maybe something like this? I know it isn't a web application but it should give you the general principles of stock market techniques which are used in the real world
using System;
using System.Collections.Generic;
namespace Stock
{
public struct StockShare
{
string Name;
long Value;
}
public class StockMarket
{
public static void Main(string[] args)
{
List<stockshare> stocks = new List<stockshare>();
Random rnd = new Random();
while (true)
{
foreach(StockShare stock in stocks)
{
int crashBy = rnd.Next(100, 5000);
if(stock.Value >= crashBy)
{
Console.WriteLine("Old value of " + stock.Name + ": " + stock.Value.ToString());
stock.Value -= rnd.Next(100, 5000);
Console.WriteLine("New value of " + stock.Name + ": " + stock.Value.ToString());
}
else
{
BailOut(stock);
Console.WriteLine(stock.Name + " has been bailed out. Expect further corruption");
}
}
}
}
public static void Bailout(StockShare stock)
{
stock.Value += 1000000;
}
}
}</stockshare></stockshare>
|
|
|
|
|
1 - we have an ASP.NET forum
2 - if you're going to ask a question this broad, it's a fair sign that you don't have the skills needed for the task
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am creating simple application for some mmorpg that doesn't support macross.
This application uses shortkeys ALT+F1,2,3...
I want to execute "/hello" emotion by clicking ALT+F1.
For hotkey I use this application - http://www.codeproject.com/KB/miscctrl/systemhotkey.aspx (It works in background)
I try to use this function:
SendKeys.Send("{Enter}{Divide}" + "hello" + "{Enter}");
but game's window doesn't receive this {Enter}.
How can I simulate clicking "Enter" in game's window?
modified on Sunday, February 22, 2009 1:51 PM
|
|
|
|
|
Hi,
I want to develop a backup software to sync the updated files only instead of backing up everything every time..
how can I do that? and how can I detect the modified files only?
|
|
|
|
|
You can use Sync Framework.
|
|
|
|
|
Check the LastWriteTime? (see FileInfo)
|
|
|
|
|
I am trying to create an array of structs that contain an array using the following code which generates the attached error:
<pre> // Structure of address message
public struct ADRMSG
{
public int ulPGN;
public byte PGNspec;
public byte SourceAddress;
unsafe public fixed byte RxData[8];
}
// Create array of 10 address messages
ADRMSG[] arAdrMsg = new ADRMSG[10];
// Create message indexes
private static int AdrMsgFront = 1;
private static int AdrMsgRear = 0;
unsafe public void fred()
{
arAdrMsg[3].ulPGN = 1;
arAdrMsg[0].PGNspec = 0XFF;
arAdrMsg[0].RxData[0] = 0x00;
}
// Error: You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement.
</pre>
I have tried every addition of fixed I can think of but cant avoid this error. Any suggestions please?
Cheers, Bruce
|
|
|
|
|
Why does RxData[] have to be declared as unsafe and fixed?
From what I understand unsafe and fixed are used when dealing with pointers (i.e. C/C++ like pointers).
Might be worth checking usage.
Regards
David R
|
|
|
|
|
AIUI it has to be fixed to allocate the 8 bytes and because of this it has to be declared unsafe.
Bruce
|
|
|
|
|
I've had a play with this and hit the same problem. I don't know enough about how C# gets addresses to see an obvious solution.
However, this does compile:
class ADRMSG
{
public int ulPGN;
public byte PGNspec;
public byte SourceAddress;
unsafe public byte[] RxData = new byte [8];
}
ADRMSG[] arAdrMsg = new ADRMSG[10];
private static int AdrMsgFront = 1;
private static int AdrMsgRear = 0;
unsafe public void fred()
{
arAdrMsg[3].ulPGN = 1;
arAdrMsg[0].PGNspec = 0XFF;
arAdrMsg[0].RxData[0] = 0x00;
}
I'm not sure it will give what you want if the address of the RxData array has to be fixed.
If I think of anything before I go to bed I'll let you know.
Regards
David R
|
|
|
|
|
Thanks David, I am still thinking C rather than C# ! Setting it up as a class rather than a struct looks like it will fix my problems.
Cheers, Bruce
|
|
|
|
|
Glad to be of help
Funnily, my other post came because I thought in C not c#
Regards
David R
|
|
|
|
|
Had a think, and came up with this:
unsafe public void fred()
{
arAdrMsg[3].ulPGN = 1;
arAdrMsg[0].PGNspec = 0XFF;
fixed (ADRMSG* p = &arAdrMsg[0])
{
p->RxData[0] = (byte)0x00;
}
}
Again, it compiles but I don't know if it does what you want.
Regards
David R
|
|
|
|
|
Hi Bruce,
I don't know what the purpose of your question is, anyway fixing a member of a struct, while the struct could be anywhere doesn't make much sense: the offset of the member within the struct will be determined at compile-time, it will not change at run-time; and the location of the struct may or may not change, depending on where it lives: as a local variable, it sits on the stack and can't change; as a member of a reference type, it moves together with that reference type.
So what are you doing? is there any Win32 P/Invoke involved? or a fixed file format? or what?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:30 AM
|
|
|
|
|
Hi Luc,
Thanks for your response. We have no requirement to "fix" any storage location but when incorporating the array within the struct in order to identify there are 8 bytes within the array the compiler wanted it to be "fixed". We just need a circular queued array of strucures that can be acted upon within this class and also added to from an external class.
Cheers, Bruce
|
|
|
|
|
Hi Bruce,
if your struct is used in managed code only, and does not have to exactly match either a file structure or some unmanaged struct (as in Win32 API), then I suggest:
- you remove all the unsafe and fixed stuff;
- you use a regular array in that struct;
- optionally you add a constructor to your struct, which creates the array with 8 elements.
So it would look along these lines:
struct aha {
public int someInt;
public int[] theArray;
public aha() {
theArray=new int[8];
}
}
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:30 AM
|
|
|
|