|
Check out
http://msdn.microsoft.com/subscriptions/[^]
For sure, they are not free. You have to purchase MSDN Subscription for the same. You may however like to try the freely available Express equivalents subject to the EULA that are displayed.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi all,
Under my machine I have installed .Net framework v1.1, v2.0 and v3.0
How can I know which version is being used by my applications ?
Thanks
|
|
|
|
|
Hi,
this is only a partial answer to your question:
string s=Environment.Version.ToString();
if (s=="1.1.4322.573") s=s+" (= 1.1 without Service Packs)";
else if(s=="1.1.4322.2032") s=s+" (= 1.1 with SP1)";
else if(s.StartsWith("1.1.")) s=s+" (= unknown 1.1 flavor)";
else if(s=="2.0.50727.832") s=s+" (= 2.0 without Service Packs)";
else if(s=="2.0.50727.1433") s=s+" (= 2.0 with SP1)";
else if(s.StartsWith("2.0.")) s=s+" (= unknown 2.0 flavor)";
Console.WriteLine(s);
It lacks information on 1.0, 3.0 and 3.5, and does not answer the question from
outside the app.
I too would like to know how to programmatically ask an EXE which Framework it needs
without launching it.
Luc Pattyn [Forum Guidelines] [My Articles]
this months 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
|
|
|
|
|
The question is complicated by the fact that version 3.0 and 3.5 do not update the JIT compiler nor the base class libraries. Officially, anyway - 3.5 shipped simultaneously with (and requires) 2.0 SP1 which does update the CLR and BCL.
To determine the version of the CLR required, you can use the Assembly.ImageRuntimeVersion property, if you load the assembly using reflection. To determine if libraries from 3.0 or 3.5 are required you will need to use GetReferencedAssemblies and inspect the assemblies that are being loaded.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Iam having an aspx file in which the background is the image and iam using a label on that image to store some text.I want this file to be exported to pdf format :?: without loss of any information(that is if i try to export as pdf file then iam getting only the label but not with the background image.)i want this to be coded in c# for the betterment of the application.can anyone tell me that how to export an aspx file to pdf format without loss of any information.(I have tried one method like first converting the aspx file to image file and then exporting it to an pdf file which doesnt work;P.)
pintoo
|
|
|
|
|
|
I'm guessing I have made a basic error here: A friend asked me if I could write a little app to query a MOHAA console. Connection works perfectly first time but then hangs after the second send/receive.
Any advice (and especially with an explanation!) VERY VERY gratefully received.
TY
<br />
IPAddress GroupAddress = IPAddress.Parse(ConfigurationManager.AppSettings["ip"]);<br />
Int32 GroupPort = Int32.Parse(ConfigurationManager.AppSettings["port"]);<br />
IPEndPoint ep = new IPEndPoint(GroupAddress, GroupPort);<br />
<br />
String message = "ÿÿÿÿ" + (Char)2 + "rcon " +<br />
ConfigurationManager.AppSettings["password"] +<br />
" serverinfo";<br />
<br />
Byte[] sBuffer = Encoding.Default.GetBytes(message);<br />
udp.Send(sBuffer, sBuffer.Length, ep);<br />
Byte[] rcvBytes = udp.Receive(ref ep);<br />
String returnData = Encoding.ASCII.GetString(rcvBytes);<br />
String[] returnDataSplit = Regex.Split(returnData, "\n", RegexOptions.IgnoreCase);<br />
foreach (String str in returnDataSplit)<br />
{<br />
Console.WriteLine(str);<br />
}<br />
<br />
message = "ÿÿÿÿ" + (Char)2 + "rcon " +<br />
ConfigurationManager.AppSettings["password"] +<br />
" status";<br />
sBuffer = Encoding.Default.GetBytes(message);<br />
udp.Send(sBuffer, sBuffer.Length, ep);<br />
rcvBytes = udp.Receive(ref ep);<br />
returnData = Encoding.ASCII.GetString(rcvBytes);<br />
returnDataSplit = Regex.Split(returnData, "\n", RegexOptions.IgnoreCase);<br />
foreach (String str in returnDataSplit)<br />
{<br />
Console.WriteLine(str);<br />
}<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine(ex.Message);<br />
}<br />
<br />
Console.Read();<br />
|
|
|
|
|
A couple of possibilities come to mind:
1. You didn't include your initialization code. Something there could be hanging.
2. Your receive code assumes that the response from the server fits into one datagram.
Take a look at the UdpClient class[^] for a sample UdpClient.
John
My opinions only!
Sites of Interest: MSDN Events | US ISV Team Blog
|
|
|
|
|
I need to send a e-mail with attachment from my win application.
Can I check (and how) whether connection to internet exists?
So far I'm dealing it like this:
try<br />
{<br />
SendMailMethod(to,from, attachement);<br />
}<br />
catch(exception)<br />
{<br />
}
Is there a better (proper) way to do it?
|
|
|
|
|
If you really want something about network sanity, try out Dns.Resolve .
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Ping the gateway or a well-known server:
(from http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx[^]):
using System;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
namespace Examples.System.Net.NetworkInformation.PingTest
{
public class PingExample
{
// args[0] can be an IPaddress or host name.
public static void Main (string[] args)
{
Ping pingSender = new Ping ();
PingOptions options = new PingOptions ();
// Use the default Ttl value which is 128,
// but change the fragmentation behavior.
options.DontFragment = true;
// Create a buffer of 32 bytes of data to be transmitted.
string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
byte[] buffer = Encoding.ASCII.GetBytes (data);
int timeout = 120;
PingReply reply = pingSender.Send (args[0], timeout, buffer, options);
if (reply.Status == IPStatus.Success)
{
Console.WriteLine ("Address: {0}", reply.Address.ToString ());
Console.WriteLine ("RoundTrip time: {0}", reply.RoundtripTime);
Console.WriteLine ("Time to live: {0}", reply.Options.Ttl);
Console.WriteLine ("Don't fragment: {0}", reply.Options.DontFragment);
Console.WriteLine ("Buffer size: {0}", reply.Buffer.Length);
}
}
}
}
|
|
|
|
|
How does one put text on a progressbar control? I can't seem to find a property or function for that.
-- modified at 9:38 Sunday 25th November, 2007
I was already using a user control to give me a smooth bar (got the code from the microsoft site). I just added some extra code to allow me to set and draw the text.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi John,
text labels are not supported by the ProgressBar control.
This article[^] shows it is rather easy to add a progress indicator to a Label tho.
Luc Pattyn [Forum Guidelines] [My Articles]
this months 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
|
|
|
|
|
EventLog or custom log (text or XML document on predefined place)?
I am preparing for 70-536 exam, and I am working on some home brew exception handling for personal project, and I was wandering which solution is better?
In company of my first employment text logs in bin folder were canon, at least for errors and warnings.
In company in which I work now, EventLog is used almost exclusively.
None of the programmers in both companies couldn't explain their opinions and preferences with good arguments, first were simplicity advocates and second are somewhat coding purists/exhibitionist.
Seers and Gandalfs with eons of experience I summon ye!
|
|
|
|
|
Hi,
logging everything to the EventLog isn't so good if you ask me. It should only be used if it is really system critical and is only appropriate for very few logs. Logging to a file is better. But it should be done in some user specific directory. Vista for example doesn't like it much if you change the programs folder.
Have a look at log4net[^]. With it you can "just log" in your application. The configuration file than controls which logs of what level in which class get logged to a file, the EventLog or some other destination. You can also easiliy change this behaviour once your application is deployed.
Robert
|
|
|
|
|
|
log4net
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I use my own XML-based logging.
Some of us are old dogs and EventLog is a new trick.
If you get in the habit of using EventLog what will you do when you need to write a non-Windows app?
|
|
|
|
|
Hi all. I was wondering if there is a way to specify a desired resolution (e.g. one second) and receive update notifications at the precise moment the system's time changes at that resolution.
For example, I would like to set up a simple clock in a form that matches exactly the seconds tick of the system clock (DateTime.Now).
I realize I could set up a timer for say 1000 milliseconds, but there is the potential for this to be randomly offset from the actual system time by as much as half a second... and clearly worse if I want my resolution to be minutes.
Is there any built-in or clever way of doing this? The best I can come up with would just be to set a timer to fire at very small intervals (say 10ms) and just do the math myself, but I worry that this would be excessive (I don't like to have a timer fire that often).
Any thoughts? Is there any Win32 mechanism?
{o,o}.oO( Did somebody say MouseDown? )
|)””’)
-”-”-
|
|
|
|
|
There is no way you can achieve that on a standard PC; the Windows kernel is not a real-time
kernel, so at best it makes a good effort at doing everything that is required with an
acceptable delay. Have you noticed the number of processes and threads on a typical system?
They all try to get their share of the CPU cycles!
What you can do is install a periodic timer that ticks a few times in your required
period (say at 200 msec if you want 1 second); that way, if your process gets a sufficient
share of the CPU cycles, it will be able to see a new period has elapsed with an accuracy
of around 20%. You can improve on the numbers but:
- shorter ticks will increase the CPU load of your process;
- other processes that are running on a higher priority, as well as all interrupts (e.g.
network traffic) may temporarily shut off your process, in which case the actual timer tick
will be seen late.
Another thing you can try is increase the process or thread priority, but as soon as they
go "above normal" other interactive actions may suffer.
The best result can be obtained by writing a device driver, which could run at a "real-time
priority", that is above all interactive tasks. But that excludes the use of .NET, the
CLR and its managed languages.
BTW: if you are relying on standard .NET timer classes for good accuracy, you may want
to read my timers article.
Luc Pattyn [Forum Guidelines] [My Articles]
this months 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
|
|
|
|
|
Luc Pattyn wrote: BTW: if you are relying on standard .NET timer classes for good accuracy, you may want
to read my timers article.
Interesting read. Thanks.
{o,o}.oO( Did somebody say MouseDown? )
|)””’)
-”-”-
|
|
|
|
|
I just want to make a software that needs some calculations and waveform plot in matlab...
I have written the required .m files and using the combuilder of matlab 7 to generate the com files to be used in VB .Net. but after compilation in VB .Net the generated stand alone exe file still needs the MATLAB RUNTIME LIBRARY. Is there any possible way to make it independent of The MATLAB And its Run time library....
Thank You.......
@rish
|
|
|
|
|
Atrish wrote: but after compilation in VB .Net the generated stand alone exe file still needs the MATLAB RUNTIME LIBRARY.
True. Your C# assembly requires calls to be routed to the MatLab library.
Atrish wrote: Is there any possible way to make it independent of The MATLAB And its Run time library....
I don't think so having a static binding of a third party library into our assembly giving one monolithic application.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Atrish wrote: Is there any possible way to make it independent of The MATLAB And its Run time library....
No. Static linking is not supported in the .NET compilers. You must install the MATLAB runtime library to get this to work.
|
|
|
|
|
I have a great trouble! My client app uses a IpcChannel-based server which registers my remote type. This server is started by my client. From time to time I have to restart the server and create new instance of my remote type. At the moments of such re-creations I have exceptions: "Can't write to IPC-port: port closing is pending". So, I have to use try-catch block and create new instances two times: 1st time -> exception (and closing of the port), 2nd time -> normal creation of new instance. Do anybody know what I have to do with it?
PS: sometimes I get an OutOfMemoryException at the creation moments of the remote type. What could be a reason of it?
|
|
|
|