|
Heath Stewart wrote:
the site looked much better after I wrote the initial bits until marketing got ahold of it!
Hehe....marketing people...
- Nick Parker My Blog
|
|
|
|
|
I've been under the general impression that the commercial .NET applications are primarily oriented toward specific business types or tasks. This sort of software is marketted in a way that the clients are likely to not even know that .NET is being used, and are even less likely to care before purchase of the product. (If it works, we want it.)
Anyway, our company as been using .NET at client sites for well over a year now (maybe 2).
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Hi,
I have a question, so if you have some ideas, please tell me.
I'm developing file download tool using WebClient class.
But I have a trouble. After downloaded file, I checked it.
The file's timestamp changed to be downloaded time.
I'd like to get how to download file not to change timestamp.
I'm looking for some solution, but I can't.
The following is file download routine.
---------------------------------------------------------
wc = new WebClient();
myCache = new CredentialCache();
myCache.Add(new Uri(sFrom_Download),"Basic", new NetworkCredential(sUser, sPassword));
wc.Credentials = myCache;
wc.DownloadFile(sFrom_Download, sTo_Download);
---------------------------------------------------------
Thank you in advance for your kindness.
Best Regards,
yu-yu
|
|
|
|
|
Do you mean the timestamp of the original file on your filesystem, or do you want to use the timestamp of the file that was on the server?
In the former case, if the file exists (see File.Exists ) get the last modification date by using a FileInfo that points to it and store the FileInfo.LastWriteTime . After you finish writing the file, set the FileInfo.LastWriteTime to the DateTime you stored previously.
In the latter case, don't use the WebClient ; use the HttpWebRequest and HttpWebResponse which are very easy to use and very robust. They are built on the asynchronous pluggable protocol system of .NET and if you look at the documentation for either of those you will find many useful examples.
So, after you make your request and call HttpWebRequest.GetResponse (and cast it to a HttpWebResponse ), you can get the HttpWebResponse.LastModified date. AFter you write the file using a buffer, again create a FileInfo instance pointing to that download file and set the FileInfo.LastModified date.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Dear Mr.Stewart
Thank you for your advice.
I will try it.
Best regards,
yu-yu
|
|
|
|
|
Does anyone how to solve this problem. When I load my XML file with System.XML.XMLDocument. I get this error message
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll<br />
<br />
Additional information: Error loading XML file c:\winnt\microsoft.net\framework\v1.0.3705\Config\machine.config Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
Thanks in advance
|
|
|
|
|
The exception is thrown by the CLR when you don't have the specified permission. In this case, the requested permissions is a StrongNameIdentityPermissions . Reading the machine.config is a protected operation (it contains machine-sensitive information) so you're assembly has to be signed (and honestly, it should anyway).
To sign your assembly, generate a key pair (public and private keys) using "sn.exe -k KeyFile.snk" and put it somewhere safe. You should actually try to use this for all your code, but do not distribute it to anyone but - if applicable - your development team (unless you use late-signing and have a build master). Make sure you have an assembly-level AssemblyVersionAttribute and either an AssemblyKeyFileAttribute or AssemblyKeyNameAttribute . If you created your project with VS.NET, you will find these in your AssemblyInfo.cs file (but the can be placed anywhere so long as they're prefixed with [assembly: ...] ). This creates a strong-named assembly.
Read the documentation about the AssemblyKey* attributes toward the bottom of the file. It's also recommended in multi-project solutions that you do not use a automatically-generated version number because things can easily get out of hand.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hello people,
forgive me for my ignorance but I am not able to get the right words to describe this thing being done on the messages in codeproject.com:
We see the Subject (as a hyperlink). When we click on it we remain on the same page but the text / comments opens up allowing the reader to view.
Please let me know what do we call this? Also I would really appreciate it if you'all could cite any good articles on this.
Regards,
Tiruvan
|
|
|
|
|
Its javaScript. In IE select View-->Source and search for "DynMessLink" You'll notice that the anchor elements for the posts have this id.
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
Colin,
Thank you for responding. But can you be a little more specific. I do see the DynMessLink but what does it mean and is it the same in .NET as it is in ASP (since this site was built on ASP)
Regards,
Tiruvan
|
|
|
|
|
Tiruvan wrote:
is it the same in .NET as it is in ASP
It is in javaScript not ASP nor .NET. You could use it on any HTML page regardless of the server engine.
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
Is "DynMessLink" the same as:
http://javascript.internet.com/bgeffects/write-layer.html
http://javascript.internet.com/page-details/division-control.html
Regards,
Tiruvan
|
|
|
|
|
|
Thanks for the link.
Is it really tough to create something like it?
Is known as the collapsible panel?
Regards,
Tiruvan
|
|
|
|
|
I found a good article on the same subject:
http://www.codeproject.com/aspnet/ExpandingDiv.asp?target=collapsible
Regards,
Tiruvan
|
|
|
|
|
Hi,
I have just converted a Console application to a class library. When I tested it out, it does not seem to find the configuration I have specified in the App.Config. It reads the configuration file fine when it is an console app.
How do I specify the configuration file that goes with the class library?
Thanks.
Sue
|
|
|
|
|
A configuration file is associated with an application by the loader. For applications executed from the shell, the app loader creates an unmanaged _AppDomain which creates an AppDomain , set the AppDomain.SetupInformation.ConfigurationFile to the path of the application file plus ".config", and executes the entry point. The .config file must therefore be named "MyApp.exe.config" and be in the application path. For a smart client, the same rules apply or the IEExec.exe application will also read the <link ref="configuration" href="path/to.config"> in your HTML document's header. There is nothing like this documented for a CCW (COM-Callable Wrapper) but last time I tried creating a .config file for the application that uses your COM object using the naming convention discussed above (even though the application used java.exe) the CCW was able to read it (the AppDomain setup by mscoree.dll in which, by default, your CCW is hosted) apparently uses the executable name still).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi Heath,
I guess I do not understand which name it is looking for...
I have a class library, xyz.dll, which I export a class MyNamespace.MySubNamespace.xyz via System.Runtime.InteropServices. What configuration filename will mscoree.dll look for? xyz.dll.config or xyz.config or MyNamespace.MySubnamespace.xyz.config.
I think I have tried them all.. it does not seem to work.
Can I setup something in mscoree.dll?
Thanks.
Sue
|
|
|
|
|
You have to name the .config file according to the executable (.exe) naming convention for whatever application instantiates your control. For instance, lets say you want to test you control in the ActiveX Control Test Container (tstcon32.exe). You would put a txtcon32.exe.config file in the same directory as txtcon32.exe. Last time I tried this (some time back) it worked. Give it a try now. The ActiveX Control Test Container would be a good test without having to write a new COM client, too.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Great! Thanks! It works. Yes, as soon as I rename the config as the COM client as the prefix, the config file is read.
Best regards,
Sue
|
|
|
|
|
Hello All,
I am trying to use remoting to allow a client access to an object that has already been instantiated on a remote server. My thought was that I could create an object that would be offered up by remoting to clients which would have a reference to this already instantiated object, that way clients would be able to get at this variable which contains state information about the program running server-side. However, after reading about remoting from several different sources I am unable to figure out how to actually pass this reference to an existing object into the object that will be offered to the client over remoting.
If anyone can provide me any insight into this subject, I would be greately appreciative.
Thanks,
- Brian
|
|
|
|
|
I suggest you to go to www.ingorammer.com[^].
To publish an specific instance of an object via Remoting, you need to add something like this on your server application...
Remoting.RemotingServices.Marshal(yourObject,"YourObject.rem);
The config file on the server will have something like...
On the Client...
YourObject vobject = (YourObject )Activator.GetObject(GetType(YourObject),"tcp://server:5020/YourObject.rem")
Also you need to load Remoting configuration for both applications...
Free your mind...
|
|
|
|
|
Hello,
There is what I want to do. I worked on the problem since 6 hours but I had a problem (probably stupid) and I dont know how to resolve it.
I need to have an Mouse Event Click when I click on the frame of a window form ( like the title bar of a window).
If I handle the mousee events with my window's forme instance, i only can handle it on the ClientSize area.
After, I tryed to handle the messages with WndProc and DefWndProc. The problem is that this is the same messages.
What I what, it's only be notified when I click on the title bar of my my application's window. The problem is how to handle this with C# becose in old Win32 this is not a problem.
Any hints?
Tahnk for you help!
Salutations,
|
|
|
|
|
The window frame is not part of the form and has to be handled differently. In the case of the frame for you main form, you can use an IMessageFilter implementation to get notification of a click:
using System;
using System.Windows.Forms;
public class Test : Form, IMessageFilter
{
public static void Main()
{
Test t = new Test();
Application.AddMessageFilter(t);
Application.Run(t);
Application.RemoveMessageFilter(t);
}
public Test()
{
this.Text = "Test";
}
bool IMessageFilter.PreFilterMessage(ref Message m)
{
if (m.Msg == WM_NCLBUTTONDOWN)
MessageBox.Show("You clicked the Window frame");
return false;
}
private const int WM_NCLBUTTONDOWN = 0x00a1;
} See documentation for the WM_NC* messages for more information about non-client notification messages that you can handle in an IMessageFilter implementation.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'm curious as to what kind of market penetration C# has achieved in the freeware/shareware/hobby-ware application segment. It seems that virtually everything that you see on sites like Download.com are still written in Visual C++ or VB. Am I wrong about that, or has C# been embraced by developers and users of this classification of applications and utilities?
|
|
|
|