|
Actually I'm studying Law.
Pits fall into Chuck Norris.
|
|
|
|
|
I now actually have code that says that. The following code compiles and runs targeting 2.0:
class Program
{
static string MyName { get; set; }
static DateTime MyDob { get; set; }
static void Main(string[] args)
{
MyName = "Brady Kelly";
MyDob = new DateTime(1969, 12, 13);
Console.WriteLine(MyName);
Console.WriteLine(MyDob.ToString());
}
}
Pits fall into Chuck Norris.
|
|
|
|
|
They are syntactic sugar. When you downgrade a 3.5 project to 2.0, you get the C# 2.0 compiler which doesn't understand them.
Calling it ".NET 3.5" made people expect that there was a new runtime. There isn't. The CLR is still version 2.0.50727 (although SP1 is required). Windows Forms is unchanged. .NET 3.0 was pure extensions, "3.5" ships with service packs for .NET 2.0 and WinFX.NET 3.0 to add a few new features to the assemblies which shipped in those versions.
As long as you don't use any of the new ".NET 3.5" libraries, or compiler features which require runtime support in the new libraries (e.g. LINQ), your code will still run against .NET 2.0, even if you're 'targeting' .NET 3.5.
Visual Studio 2008's "multi-targeting" is a sham. It's really targetting the same runtime throughout. It doesn't offer the ability to target .NET 1.1, which would have been really useful.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Mike Dimmick wrote: It doesn't offer the ability to target .NET 1.1, which would have been really useful.
Why? Is there any compelling reason to not upgrade to 2.0?
Pits fall into Chuck Norris.
|
|
|
|
|
The reason why Microsoft didn't add .NET 1.1 targeting is because Microsoft wants more money. .NET 1.1 is still needed for older systems (school computers) that may not be as up-to-date as they should be.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
It's a feature of the C# compiler. If you're targetting .NET 2.0 with VS2008 then you can use automatic properties. These can run under .NET 2.0 but if you cannot compile the same source code in VS2005 because it doesn't support automatic properties.
|
|
|
|
|
Is there a way to use a generic dialog to prompt the user for report parameters using .NET RDLC reports? The ReportParameterInfo class contains properties such as "Prompt", which leads me to believe something should exist, but I can't seem to find it!
I remember doing something like this in Crystal Reports, but I can't seem to find anything similar using plain .NET.
I could probably write my own generic dialog, passing in a ReportParameterInfoCollection and displaying the appropriate controls for the user to enter the report parameters, but it seems like something like this should already exist. If it doesn't, then I might just write one and submit it as a new article, but I don't want to waste time re-inventing a wheel that I can't find!
Thanks.
|
|
|
|
|
Hi,
I want to do simple thing but I can't and I'm confused. I want to send a simple at command to my modem.
like atdt8889653
SerialPort s = new SerialPort("com3", 2400, Parity.None, 8, StopBits.One);<br />
try{<br />
s.Open();<br />
s.Write("atdt8889653");<br />
...<br />
}<br />
catch<br />
{<br />
...<br />
}
but it seems it doesn't work because my modem doesn't call;
my apps is win form
I see this code
http://www.dreamincode.net/forums/showtopic35775.htm[^]
but it doesn't work.
(I can connect to my modem via hyper terminal and type at commands and get correct responces)
|
|
|
|
|
Hi,
Do you need to append a carriage return to your command strings? HyperTerminal would do this when you press the enter key.
Alan.
|
|
|
|
|
Thanks a lot.
Yes I must add carriage return to the end of the string (+"\r").
|
|
|
|
|
Hi,
a wild guess: your modem needs hardware handshake, and you did not enable it for COM3.
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.
|
|
|
|
|
Hey everyone.
My main goal, is to sign a message with a smartcard, without raising a dialog for the pin.(C#, .NET >= 2.0).
From the example provided in:http://msdn2.microsoft.com/en-us/library/system.security.cryptography.cspparameters.aspx
I have managed to disable pin dialog raise.
With the following code, i dont need to input the pin and all went ok.
CspParameters csp = new CspParameters(1, "Datakey RSA CSP");<br />
csp.Flags = CspProviderFlags.UseDefaultKeyContainer;<br />
<br />
System.Security.SecureString pwd = new System.Security.SecureString();<br />
pwd.AppendChar('1'); pwd.AppendChar('2'); pwd.AppendChar('3'); pwd.AppendChar('4');<br />
csp.KeyPassword = pwd;<br />
<br />
csp.KeyNumber = (int)KeyNumber.Signature;<br />
<br />
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp);<br />
<br />
byte[] data = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 };<br />
<br />
Console.WriteLine("Data : " + BitConverter.ToString(data));<br />
<br />
byte[] sig = rsa.SignData(data, "SHA1");<br />
<br />
Console.WriteLine("Signature : " + BitConverter.ToString(sig));<br />
<br />
bool verified = rsa.VerifyData(data, "SHA1", sig);<br />
<br />
Console.WriteLine("Verified : " + verified);
Now i want to do the same thing with the example provided in:
http://msdn2.microsoft.com/en-us/library/bb924544.aspx
Meaning, i want to create a CmsSigner passing it the correct CspParameters, in order to sign the pkcs7 message with the smartcard without raising a dialog box for the pin.
something like:
static public byte[] SignMsg2(Byte[] msg, X509Certificate2 signerCert, bool detached)<br />
{<br />
ContentInfo contentInfo = new ContentInfo(msg);<br />
<br />
SignedCms signedCms = new SignedCms(contentInfo, detached);<br />
<br />
<br />
CspParameters csp = new CspParameters(1, "Datakey RSA CSP");<br />
csp.Flags = CspProviderFlags.UseDefaultKeyContainer;<br />
<br />
<br />
System.Security.SecureString pwd = new System.Security.SecureString();<br />
pwd.AppendChar('1'); pwd.AppendChar('2'); pwd.AppendChar('3'); pwd.AppendChar('4');<br />
csp.KeyPassword = pwd;<br />
<br />
csp.KeyNumber = (int)KeyNumber.Signature;<br />
csp.Flags = CspProviderFlags.NoPrompt;
<br />
CmsSigner cmsSigner = new CmsSigner(csp);<br />
<br />
cmsSigner.IncludeOption = X509IncludeOption.EndCertOnly;<br />
<br />
signedCms.ComputeSignature(cmsSigner, false);<br />
<br />
return signedCms.Encode();<br />
}
This does run, but has 2 major issues:
- it still asks for the pin;
- when i putt the correct pin, the message is signed and encoded (the function runs till the end), but the pkcs7 message that is returned, is wrong: in my example, i use this to sign a pdf, and it says something like: "PKCS/ Parsing error: Incorrect version";
Anyone as any input on this subject?
Really Apreciate.
Regards
|
|
|
|
|
Any1 has any input on this subject?
Really am desperate...
regards.
|
|
|
|
|
The select command selects the INBOX,DRAFTS and other folder, however it fails to select 'sent items' folder because of the space in the mailbox folder name.
How to select the Sent Items folder?
|
|
|
|
|
Try Select "Sent Items" or Select "Inbox.Sent Items".
|
|
|
|
|
Pete,
Thanks for the suggestion, however it is not working.
I am using select command to select "Sent Items" folder as follows.
'Select Sent Items'
But IMAP responds with failure response which means that the command is not valid for sent Items, but it works fine for INBOX. The space in the word creates the problem..(sent ' ' items)
How can we overcome this problem?
-Sivasankari
|
|
|
|
|
Well, I've used this command through a console application Select "Inbox.Sent Items" and this worked fine for me.
|
|
|
|
|
Wierd, could you please send your application/code snippet in which "Inbox.Sent Items" selects the 'sent items' folder if possible?
I have written "Select Inbox.Sent Items" command in network stream.
Thanks for all ur replies.
|
|
|
|
|
Hi,
I am the same user that post the original post - "Object Consistency". (now logged with my real user name). again please excuse me for my english
Thanks all of you guys , all of your posts are very informative, but i will sharp my question.
i will introduce you into my original problem from my real project.
there is a IRentable interface that represents any real life object that can be rent.
concrete rentable items like car, motocycle, or book are inherit from it.
there is also an abstract class RentProgram that describes the rules of renting
an item. for each particular rent item there is concrete rent program like MotocycleRentProgram,
all of them are inherit from RentProgram.
in addition there is an abstract class Order that contains among all others a rent item (IRentable)
and a rent program (RentProgram). for each concrete rentable item there are some specific properties
that will be exist in concrete class inheriting from Order like CarOrder.
for example when real car is returned without full fueltank, a penalty must be taken.
a cost for that penalty (fuelTankPenaltyCost) is a property of CarRentProgram, on the other hand
a status of car's fueltank (isFuelTankFull) is a part of CarOrder object end assigned by car operator
when the order is finalized.
my question is very specific. how you can ensure that every concrete order like CarOrder, MotocycleOrder and etc
will be consistent. i mean how you can ensure for example that object of type CarOrder will only contains Cars in it's
IRentable variable and only CarRentProgram in it's RentProgram variable.
that constraint must be applied for each relation of objects of the same group:
[concrete order] - [concrete rent item] - [concrete rent program]
for example:
[CarOrder] - [Car] - [CarRentProgram]
[MotocycleOrder] - [Motocycle] - [MotocycleRentProgram]
[BookOrder] - [Book] - [BookRentProgram]
assume that every concrete order can be updated over time so the constraint must be kept also
after updating methods of Order class like UpdateRentProgram(RentProgram rentProgram).
here is the class structure to complement my question:
thanks in advance
abstract class Order<br />
{<br />
protected Custumer custumer;<br />
<br />
protected DateTime deliveryDate;<br />
protected DateTime returnDate; <br />
protected Office deliveryOffice;<br />
protected Office returnOffice;<br />
protected DateTime realReturnDate;<br />
protected Office realReturnOffice;<br />
<br />
protected IRentable rentableItem;<br />
protected RentProgram rentProgram;<br />
<br />
protected List<payment> payments;<br />
<br />
protected double damageCost;<br />
protected String damageComments;<br />
<br />
protected bool isFiniliezed = false;<br />
<br />
...<br />
}<br />
<br />
abstract class RentProgram<br />
{<br />
public abstract double CalculateCost(Order order);<br />
<br />
...<br />
}<br />
<br />
class CarOrder : Order<br />
{<br />
protected double kilometers;<br />
protected bool isFuelTankFull;<br />
<br />
...<br />
}<br />
<br />
class MotocycleOrder : Order<br />
{<br />
protected double kilometers; <br />
protected bool isAlarmPresent;<br />
...<br />
}<br />
<br />
<br />
class Car : IRentable<br />
{<br />
protected int id;<br />
protected CarClass carClass;<br />
protected double kilometers;<br />
protected String name; <br />
<br />
...<br />
}<br />
<br />
class Motocycle : IRentable<br />
{<br />
protected int id; <br />
protected String name;<br />
protected double kilometers;<br />
<br />
...<br />
}<br />
<br />
<br />
class CarRentProgram : RentProgram<br />
{ <br />
protected CostDescriptor costPerKilometer;<br />
protected CostDescriptor costPerTime;<br />
protected double insuranceCost;<br />
protected double fuelTankPenaltyCost;<br />
protected double dropChargeCost;<br />
<br />
...<br />
}<br />
<br />
class MotocycleRentProgram : RentProgram<br />
{<br />
protected CostDescriptor costPerTime;<br />
protected double gadgetsCost;<br />
protected double alarmDeviceCost; <br />
<br />
...<br />
}</payment>
|
|
|
|
|
I would look at making Order a generic class with a type of IRentable. Hence, you would end up
withpublic class CarOrder : Order<Car>
{
}
public class MotorCycleOrder : Order<MotorCycle>
{
}
public abstract class Order<T> where T : IRentable
{
protected T rentableItem;
}
|
|
|
|
|
Great idea but it is not sufficient. If i understand you right then in order to force consistency
between Order, IRentable and RentProgram types there shuld be more complicated generic use:
withpublic class CarOrder : Order<Car, CarRentProgram><br />
{<br />
}<br />
<br />
public class MotorCycleOrder : Order<motorcycle, MotocycleRentProgram><br />
{<br />
}<br />
<br />
public abstract class Order<T, S> where T : IRentable, S : RentProgram <br />
{<br />
protected T rentableItem;<br />
protected S rentProgram;<br />
}<br />
Am i right ???
modified on Thursday, March 27, 2008 8:39 AM
|
|
|
|
|
This would seem to be reasonable.
|
|
|
|
|
hi guys
im developing a Biztalk 2006 application
im using microsoft enterprise Enterprise assemblies and other assemblis that i dont have the code -delayd signed assembles-
so how can re-assign the assemblies whethere i have the sorce key and the snk file or i don't have them.
thanks
ahmad dalqamouny
|
|
|
|
|
Please don't double-post. It won't help you get an answer any faster. The original is here[^].
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
hi guys
im developing a Biztalk 2006 application
im using microsoft enterprise Enterprise assemblies and other assemblis that i dont have the code -delayd signed assembles-
so how can re-assign the assemblies whethere i have the sorce key and the snk file or i don't have them.
thanks
|
|
|
|