|
dfoerder wrote: Both do not speed up the first show as much as I think would be possible.
There can be other things going on in that form when it loads the first time that can effect load time like connecting to a remote resource such as a Database or WebService etc.
You could try to pre-load the forms and not show them until they are requested.
led mike
|
|
|
|
|
Hi, thanks for the reply.
There are no remote resources involved, so only "standard" stuff should happen. I could try to preload the form, that's right. Maybe I'll try that. But I still hope to find a more universal and elegant solution...
Any other ideas?
Daniel
|
|
|
|
|
Hi i want to develop a profiling tool. I just need to add TRACE to a .net assembly's(exe or dll) all methods before its execution.
is it possible to modify the assembly by inserting code for trace?
My small attempt...
|
|
|
|
|
I developed a program which monitors a web service and upon certain events it would do a task. Initially, it was a Windows Form application which consisted of:
1) a Timer which performed business logic
2) a Settings1.settings files
3) A simple GUI which was mainly a PropertyGrid which was bound to the Settings file.
(By Settings file i mean the built in Settings file creator which has VS designer support that lets you specify user or application scope).
The application worked perfect. The business logic that executed when the Timer elapsed made use of the Settings1.settings.
Then, i refactored the business logic into an independent class (note in the same project as the Windows Form, Settings1.settings) which is called through a Windows Service Object. I kept the Windows Form application as a means to allow the user to change the settings.
But, now since each project is effectively it's own assembly. The changes made in the GUI aren't reflected in the windows service.
The Windows Form Project creates a local user configuration file where the service creates one for the "Default User". I found that i after i modify the settings in the windows form... i could copy the generated user.config file as shown below to bring the new settings into the windows service:
COPY the user.config file from:
C:\Documents and Settings\blake\Local Settings\Application Data\MyCompanyName\\eEASAlertServiceActivator_Url_i10wwnu40dieoj2szfvkyaqsxsafbbhj\2.1.2.14
TO:
C:\Documents and Settings\Default User\Local Settings\Application Data\MyCompanyName\eEASAlertServiceActivator_Url_qfzoqgk0ecwshk1ztshws5yghp51pxoc\1.1.3.4
I'm wondering what is the best practice to go from here. I like using Settings.settings file for the following reasons:
1) you get VS Designer support
2) ability to use PropertyGrid's which provide an extremely fast way of allowing users to update the settings.
3) Very simple to access "string s = Settings1.Default.MyString;"
Is there anyway that you specify the file path that the settings are read from? I looked at other solutions on code project and the alternatives don't seem to have 1, 2, or 3.
My research suggests that there isn't such a solution... which is frustrating because if only the generated Settings class had a .Save( <filepath>) and .Load( <filepath> ) it would be perfect for what i wanted to do.
Thanks In Advance,
~blake
http://www.blakerobertson.com
|
|
|
|
|
blak3r wrote: Is there anyway that you specify the file path that the settings are read from?
Yes, they hide that information in the documentation[^]
led mike
|
|
|
|
|
The settings files which are created when you create a new "Settings File" from the IDE are of type System.Configuration.ApplicationSettingsBase .
The link you pointed me to i had read before. I do not know how (if it is even possible) to use the static ConfigurationManager class in conjunction with ApplicationSettingBase.
Code sample from the "documentation".
<br />
static void ModifyCustomSection2()<br />
{<br />
System.Configuration.Configuration config =<br />
ConfigurationManager.OpenExeConfiguration(<br />
ConfigurationUserLevel.None);<br />
<br />
CustomSection custSection =<br />
config.Sections[customSectionName] as CustomSection;<br />
<br />
custSection.FileName = "anotherName.txt";<br />
custSection.MaxIdleTime = new TimeSpan(0, 20, 0);<br />
custSection.MaxUsers = custSection.MaxUsers + 20;<br />
<br />
if (!custSection.ElementInformation.IsLocked)<br />
config.Save();<br />
else<br />
Console.WriteLine("Section was locked, could not update.");<br />
Example of designer generated Settings class.
<br />
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]<br />
internal sealed partial class SettingsEmail : global::System.Configuration.ApplicationSettingsBase {<br />
<br />
private static SettingsEmail defaultInstance = ((SettingsEmail)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new SettingsEmail())));<br />
http://www.blakerobertson.com
|
|
|
|
|
bump
http://www.blakerobertson.com
|
|
|
|
|
Hi,
How should i integrate Google earth to my application without installing Google Earth to my application??
Regards,
Priya
|
|
|
|
|
I don't know but if Google Earth does not provide any developer documentation for doing that then good luck. If the do provide documentation you should be reading that instead of posting questions in a forum. HINT: Google Google Earth developer
led mike
|
|
|
|
|
Hi Mike,
I was not aware of reading documentation,thatswhy i posted like that..I almost dropped the idea of integrating... ...
Priya..
|
|
|
|
|
Hi All,
I have a scenario where in i implement a remoting service using TCP/IP. This remoting service by default accepts 25 Active concurrent connections from clients. I have to increase this to 50. Is thr any idea of achieving it……
Thanks in Advance
Cheers
Mani.
|
|
|
|
|
What version of windows is this server running on?? 2000 Workstation, 2000 Server, XP, Vista, Server 2003, Server 2008?? How many connection licenses does it have installed??
|
|
|
|
|
Its running on windows 2000 . i have no idea of connection licenses...
|
|
|
|
|
Windows 2000 Server has a default connection limit of (I think) 20 inbound connections, of any type. In order to get more connections, you have to buy more connection licenses.
Windows 2000 Workstation has an absolute limit of 10, that cannot be (legally) changed.
|
|
|
|
|
I am trying to solve a memory leak issue when accessing a serial port on a WINCE 5.0 device. My application is devloped in MSVS2008 and uses .NetCF 3.5. I have pinpointed the leak was due to a third party serial port DLL so I tried to implement the Microsoft SerialPort class. Unfortunately the memory leak still exists. I cut my code back to just the reading of the data buffer (see below) but the memory still keeps dropping constantly. Any suggestions of how to solve this problem?
private void PortOnRead(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
try
{
byte[] bData = new byte[this.sPort.BytesToRead];
int iRead = this.sPort.Read(bData,0,bData.Length);
// To Do
this.dtReceived = DateTime.Now;
}
catch { }
}
|
|
|
|
|
Hi,
I have several comments:
1.
please use PRE tags to show multi-line code snippets
2.
this does not look like actual code; what do you do with bData once it got filled?
3.
why do you think there is a memory leak? whatever .NET program you write, memory usage
will go up until at some point more memory is required and the GC (garbage collector)
kicks in and tries to free some memory (looking for objects that are no longer alive,
i.e. no longer reachable because all references to them are gone).
That would apply to bData since it is no longer reachable once your PortOnRead() method
finishes.
But, remember, the GC kicks in only when more memory is needed than is actually available
(or allowed by some internal OS settings).
So there would be a problem if your app suddenly throws an OutOfMemoryException, or
dramatically fails with some symptoms that are memory-related; and there would be no
problem at all if the memory usage (say the Working Set) keeps growing, suddenly
falls back dramatically, then grows again, etc.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Is it possible to discover the private key used in a hash algorithm if you have both a clear text value and it's hashed equivelent?
|
|
|
|
|
Probably with a PhD in Mathematics and whole lot of computing power, yes. Can it be brute forced? Yep, given sufficient time, anything can be guessed at until you get it right.
Can some schmuck off the street discover it, no.
|
|
|
|
|
Great, what I wanted to do was create a confirmation email. The link to confirm would include the email address to be confirmed in plain text, and a hashed version of the same email address. So when the email is confirmed I can hash the plain text and compare the two values to make sure it hasn't been tampered with. But I wasn't sure if it was possible to reverse engineer the private key and regenerate the hash value so it would match and bypass the validation.
|
|
|
|
|
Mark J. Miller wrote: The link to confirm would include the email address to be confirmed in plain text, and a hashed version of the same email address. So when the email is confirmed I can hash the plain text and compare the two values to make sure it hasn't been tampered with.
Why send it in plain text at all?? If the people are able to break the hash, then it's trivial for them to fake the address AND create a valid hash for it. Forget the plain text version of the address, it's just a clue to what MIGHT be in the hash. Part of security is divulging as little as possible about what the contents of the hash might be.
Instead, don't compute a one-way hash of the address. Use an symetric encryption scheme where you encrypt the address with public side of a key pair, convert it to a base 64 string to make it compatible with being in a URL, then stick that in the email. When the link is clicked, the site should convert the base64 string back into the original binary bytes, then run that through the decryption using your privatekey.
Besides, if the address doesn't show up in your "attempted, but not validated" database table, you can just ignore the address sent to you or log it in a table that tracks invalid validation attempts.
|
|
|
|
|
Thanks, I'm trying to get rid of old, bad habits and instead think and code more securely. Your response is very helpful.
|
|
|
|
|
Use a known secret key on your server, hash the address mixed with the key (xor, say) Then send the result.
People won't be able to generate a hash for an address without your key.
Of course this means you'll need to keep the hashcode in your database - in which case you may as well just give them a random confirmation guid.
Guess-the-GUID is guaranteed to be about as fun as 52 card pickup, but longer playing times
|
|
|
|
|
"Form Creator". I'm not certain there's a package out there, but basically I'm looking to create a forum for my site that can be integrated into a asp.net pages easily and have the ability to change it's look and feel so that it blends in with the exising site.
I was thinking of creating a forum from scratch but if there's somethign already pre made and pluggable, I'll download and use that instead....
Thanks.
Humble.
|
|
|
|
|
A quick google search found this[^].
|
|
|
|
|
Hi,
I have several related applications that all use Apache's log4net logging package. This package can use an XML configuration file to configure options. Furthermore, this configuration file can be embedded into the application's general App.config file by doing the following:
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<!--CONFIGURATION STUFF GOES HERE-->
</log4net>
</configuration>
Now, I don't want to have to copy the log4net.config file contents into each of the App.config files, as it is large and would make things more difficult to maintain.
I found that XML has an XInclude extension (see http://www.w3.org/TR/2003/WD-xinclude-20031110)
If I did my googling right, this means that an XML document can specify the content of another XML document to be embedded within it. Therefore, I could theoretically use XInclude to include the contents of my log4net.config file in each App.config file. Below is my attempt:
<configuration xmlns:xi="http://www.w3.org/2001/XInclude">
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<xi:include href ="log4net.config" parse="xml" />
</configuration>
However, this does not work - when the code is run the log4net configurator very obviously does not find the embedded content.
Does anyone have any suggestions for how to format the xml file to make this work? Is this even possible within .NET framework?
-klk
|
|
|
|