|
It's simple to go around Sysinternal's filemon / process monitor
For this example if the application is registered write a empty file call "appreg.dat" to the application's run path, then add this code
DirectoryInfo di = new DirectoryInfo(Application.StartupPath);
FileInfo[] rgFiles = di.GetFiles("*.*");
foreach(FileInfo fi in rgFiles)
{
if (fi.Name.ToLower() == "appreg.dat")
{
MessageBox.Show("This is the pro version!",this.Text);
}
}
Run filemon/procmon and see the file IO results. Save the log and clear the contents, delete the file and rerun the test and compare the results....
The thing is you'd have to work backwards on this example to solve it, having only a unregistered copy wouldn't help much as the registered file doesn't ever exist. You can make this much more secure by reading multiple directories and looking for more than one file ect.. This still isn't the best method, though if combined with a few others it can become fairly safe (except for reflection) or decoding the CIL. You'd need Dotfuscator and other tools to make it more safe.
I didn't say this before because it is sort of off-topic. Yet, the fact remains it is impossible to make a trial which contains full functionality DIE and not be brought back to life. The best thing is to make your trial a different program with limited use and then distribute the full version after they pay. Then someone who pays can still leak the real app to the general public, so pick your poison.
|
|
|
|
|
Hey,
I searched everywhere but was unable to find a solution somewhere:
I'm binding to a WinForms (2.0) DataGridView.
When I bind to the List(Of MyType) (List<mytype> in C#) it shows up just fine in the DataGridView. However MyType contains a List(Of MySubType) and I want each MySubType to appear as a column in the DataGridView.
What I did was wrapping up MyType like "MyTypeDescriptor : ICustomTypeDescriptor" (Implements) which exposes each MySubType as a property (I also needed a "MySubTypePropertyDesc : PropertyDescriptor" (Inherits) for this).
So I try to bind my new List(Of MyTypeDescriptor) to the DataGridView. What happens now is that the first row shows up correctly but all rows after that are a copy of the first one.
Considerations:
* The content of the List(Of MyTypeDescriptor) is correct. ie it contains the wrappers around the different MyType objects.
* When I bind the different "MyTypeDescriptor" to PropertyGrids, they show the expected data.
* I tried implementing the ITypedList but got the same incorrect result.
Anyone has an idea what I am supposed to do here?
Cheers,
Wouter
|
|
|
|
|
Wouter,
Did you get an answer? I'm having the exact same issue!
Thanks!
|
|
|
|
|
This was quite a while ago
I finished the project but I have no idea what kind of workaround was required...
At my current project we use Janus GridEx instead of the standard WinForms DataGrid(View) which is pretty neat.
http://www.janusys.com/controls/
|
|
|
|
|
Using an icon editor I create the app icon. It contains 48x48, 2 - 32x32, and 2 - 16x16 images (five in all). The first three are for the application, the last two (32 & 16) are for the document file(s) associated with the application.
The problem is that the DefaultIcon key in the registry does not associate the correct icon with the document files.
Example:
C:\Program Files\Test App\TestApp.exe,0 <- regardless the value the results are the same! X| Is there a "How to" for using icons with a VS 2005 Windows Form app?
Thanks,
Mark
|
|
|
|
|
I think you're getting caught out between how .NET handles resources and how Win32 does. Explorer uses the old Win32 model for resources; .NET has a new incompatible model.
You also need to understand how icons work. Logically, each of the images in the same icon file represent the same icon. Windows or .NET pick the appropriate image out of the file depending on the size of the image requested (e.g. large vs small icons) and the screen colour depth (the system will use the highest available colour depth in the icon file that's less than or equal to the colour depth of the screen, for the requested icon size). If it doesn't have an icon in the requested size it will synthesize one by scaling up or down the icons that are available.
What you need to do is separate your images into three icon files: one for the app, and one for each of the document files. You then need to build a Win32-style resource file using a resource script (.rc file) and the Win32 resource compiler, rc.exe, to generate a .res file. You can then go to the Application tab in the project properties in Visual Studio 2005 and select Resource File rather than Icon, and select the .res file you generated.
I think you will need to add a version resource to the .rc file as well, if you want the Version tab to appear in Windows Explorer with your company name information.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Once I ran through the process of using the resource compiler (rc.exe) to create the .res file it occurred to me that I had done this before! Some time ago. Now Windows Explorer shows the correct icons for the document files.
Thanks for the help.
Mark
|
|
|
|
|
I have made a form, but i want to remove it from my windows taskbar, it doesnot mean i want to move it to notification area or want to hide, i want it on the scrren and the same time i dont want it on windows taskbar.
|
|
|
|
|
tamour wrote: have made a form, but i want to remove it from my windows taskbar
Select the form, go to 'Properties' and change the ShowInTaskbar property to false.
|
|
|
|
|
Buddy tahnku very much. In fact really really very much.
|
|
|
|
|
Hi,
From a Windows Form I do a call to a method in an external class. I want to display a Progress Bar that show me the progress of this method.
The progress of the method is increasing in it and my problem is that i don't know how can i update the Progress Bar.
Can somebody help me?
Thanks & sorry for my awful english.
|
|
|
|
|
|
Hi
I have some problem When I'm trying to make install package.
The package what I work is very big program suite. so the package have some editions : Home, Basic, Pro Editions.
What i want is that when user installs this package and enters SN, installer choose one edition which is selected by user and install.
But The tool I'm using is Advanced Installer. but this tool doesn't support what i want.
Are there any tools?
If you know about the tool what i want, please tell me.
Thank you
|
|
|
|
|
I'd recommend NSIS, it's a very powerful installer and use it whenever I need to create an installer.
There is a bit of a learning curve to it but once you've learnt it you won't regret it.
|
|
|
|
|
I have a main form which instantiated with this command like everybody does:
Application.Run(new pdMainForm());
Problem is I want to access one of its control properties from another form but since it does not provide any instance name I couldn't find the proper way to get one of the form's control properties.
How can I access pdMainForm's control properties from another form?
Thanks in advance.
|
|
|
|
|
I code in VB.Net, and I don't typically use Application.Run() for forms the way you showed in your example. We would do something like pdMainForm.Show() , but I think I understand the concept and what you need to do is create a pointer for your main form before you start running it. So you would declare a variable with the DataType of your form's class first. Then you can run it and later you can still access it's properties the way you want to, so something like this I'm guessing:
Dim myMainForm as New pdMainForm<br />
Application.Run(myMainForm)<br />
<br />
Dim mySecondForm as New pdMainForm<br />
mySecondForm.Text = myMainForm.Text<br />
Application.Run(mySecondForm)
If this isn't what you were looking for, perhaps you could show us some more of your code and explain a bit more.
Hope this helps.
|
|
|
|
|
Try understanding and working with delegates or another approach is to pass current form's reference to other form from which your trying to control form.
|
|
|
|
|
Hi,
I'm experiencing a problem when printing text using Graphics.DrawString(). The horizontal character spacing appears inconsistent for each line of text, depending on the length of the string printed. It's pretty hard to explain what exactly is happening, but for instance, when printing:
Info::Defining 'FORCEBUILD' as 'False'
Info::Defining 'BUILDGLOBALDATA' as 'True'
Info::Defining 'BUILDTRACKINSTANCES' as 'False'
Info::Defining 'BUILDTRACKDYNAMICOBJECTS' as 'False'
Info::Defining 'BUILDTRACKSTATICOBJECTS' as 'False'
Info::Defining 'BUILDPAKFILES' as 'True'
Info::Defining 'BUILDGUIFILES' as 'False'
Info::Defining 'BUILDAICHARACTERSKINS' as 'False'
Info::Defining 'BUILDDRIVERCHARACTERSKINS' as 'False'
The first column of ' characters after Defining are aligned differently horizontally.
This is using the controls standard font MS San Serif 8.25, with all the system default text rendering settings.
I've tried changing the TextRenderingHint in the Graphics object, and found that TextRenderingHint.SingleBitPerPixel gives a consistent alignment, but looks awful, where the default seems to be TextRenderingHint.SingleBitPerPixelGridFit, (although TextRenderingHint.AntiAliasGridFit looks the same to me), giving the mis-aligned text.
[EDIT: In addition to this issue, when printing multi line text as above, the vertical spacing for each line of text is not consistent, ie. the vertical distance between each line of text is not the same number of pixels, some are 12 and some are 13 pixels, suggesting underlying floating point math.]
Any advice appreciated.
Cheers,
Andy.
modified on Thursday, April 24, 2008 6:44 AM
|
|
|
|
|
Hi all,
i am facing one problem in my windows application,
DateTime days;
DateTime day1;
DateTime day2;
day1 = (Convert.ToDateTime(dtdata1.Rows[0]["firstrepaymentduedate"]));
day2=(Convert.ToDateTime(dtdata1.Rows[0]["trenchdate"]));
decimal interestrate;
int outstandingamount;
decimal interestamount = (outstandingamount * interestrate * days) / 365;
here days is in datetime but interestamount is decimal.
so we are getting error in converting datetime to decimal
please any body knows this solution please give reply to me as soon as possible
thanks & regards
sarp
sarp
|
|
|
|
|
Use TimeSpan.Days.
also don't ask us to reply as soon as possible...
|
|
|
|
|
Hello All,
I Have One form when I click button There another form contain login when user click button ok it check user name and password if it is correct it is close login form
How can I do That, Please.
|
|
|
|
|
|
Hi All,
how to freeze the column in listview.for exe: click the listview header,left hand side of the selected column will remain static and visible, especially when the user scrolls right across the table/row to view columns currently out of view.
Thanks,
aravindakumar
|
|
|
|
|
Hi all,
I have 2 forms , formMain and formChild. What i wanna do is when the mouse is leave the formChild then it will become tranperancy. When the mouse move over the formchild then transperancy become 1 again.How can i archive it?
Any tips are welcome.
Thanks in advance
regards
cocoon
|
|
|
|
|
There's a mouse leave event, or you can capture the mouse and detect from it's move event when it left your form.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|