|
Ok, I know that this is something stupid... but I'm trying to write my first project in C#. Unfortunately I have only VS 2005 (my friend is using Express Ed).
The lab machine that project must work on have .NET 1.1
Is there any way to set VS to compile my project with .NET 1.1
I want to be sure that what I'm using will be working on machine with .NET 1.1 and without .NET 2.0
Please give some help about that, If this is stupis question then fill free to write that (along with explanation).
I need to finish the project fast... thats way I can't afford to search this information or to actually test my app on machine with .NET 1.1
Thanks for any help
best regards,
Slawek
PS. link to MSDN page will be great
|
|
|
|
|
|
http://msdn.microsoft.com/vstudio/downloads/tools/msbee/default.aspx
string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
Im trying to read out an xml file which has several files inside like this:
<File Name="Luc.JPG" Src="50000000.000"><br />
- <MetaInfo><br />
<MetaKey Name="vti_modifiedby" Value="SR|SCALEHOSTING\scale" /><br />
<MetaKey Name="vti_filesize" Value="IR|384548" /><br />
<MetaKey Name="vti_timecreated" Value="TR|30 Jun 2006 16:30:19 -0000" /><br />
<MetaKey Name="vti_lastheight" Value="IX|1200" /><br />
<MetaKey Name="vti_timelastmodified" Value="TR|30 Jun 2006 16:30:19 -0000" /><br />
<MetaKey Name="vti_lastwidth" Value="IX|1600" /><br />
<MetaKey Name="vti_author" Value="SR|SCALEHOSTING\scale" /><br />
<MetaKey Name="vti_sourcecontrolversion" Value="SR|V1" /><br />
<MetaKey Name="vti_sourcecontrolcookie" Value="SR|fp_internal" /><br />
</MetaInfo><br />
</File>
I have tryed several examples but i simply cant figure it out,
any help appriciated.
Scale.
|
|
|
|
|
You are going to have to be more specific as to what your problem is
only two letters away from being an asset
|
|
|
|
|
Ill try i have a file manifest.xml,
its filled with file entry's an example of a file entry:
<file name="Luc.JPG" src="50000000.000">
- <metainfo>
<metakey name="vti_modifiedby" value="SR|SCALEHOSTING\scale">
<metakey name="vti_filesize" value="IR|384548">
<metakey name="vti_timecreated" value="TR|30 Jun 2006 16:30:19 -0000">
<metakey name="vti_lastheight" value="IX|1200">
<metakey name="vti_timelastmodified" value="TR|30 Jun 2006 16:30:19 -0000">
<metakey name="vti_lastwidth" value="IX|1600">
<metakey name="vti_author" value="SR|SCALEHOSTING\scale">
<metakey name="vti_sourcecontrolversion" value="SR|V1">
<metakey name="vti_sourcecontrolcookie" value="SR|fp_internal">
On disk i have a 500000000.000 file which i need to rename into luc.jpg (the rest aint that important).
But i cant figure out how to read out all the specif lines with
|
|
|
|
|
Scalee wrote: I hope this is beter explained
No
only two letters away from being an asset
|
|
|
|
|
The most simple way i can put it would be:
I have an XML file with allot of lines:
<file name="Luc.JPG" src="50000000.000"> but difference source and file names.
Also allot of other crap.
Now i need to read out that XML file and get all lines that start with
|
|
|
|
|
hi,
i have a read write communication form one port of my pc to another working fine, but i can't send spacial characters like é#§èçà i get a ? on the received side.
does anybody know what i should add to my project?
thx
|
|
|
|
|
Hello
If you are using byte arrays to comunicate with your post, then it should work fine, and the interpretaion is the responsibility of the recipient.
If you are using strings to transfer data to/from your port, then check the Encoding of your string.
One last note... Are you sing .Net 2.0 framework?
Regards
|
|
|
|
|
yes i am and i use textbox.text = port.readline() function
so were should i check the encoding?
thx
|
|
|
|
|
Hello
Try this conversion. It's not the best practice but fever got my mind blind. I can't really think of something better at the moment.
textbox.Text = Encoding.UTF32.GetString(Encoding.UTF32.GetBytes(port.ReadLine()));
If it doesn't work, try using other encodings provided in the Encoding class.
Regards
|
|
|
|
|
to bad non of the encodings work, perhaps i should encode the sended text?
but i'm not sure how i convert the txtbox string to a byte[] or char[]
so i can use: port.writeline(encoding.utf32.getbyte(textbox.text))
thx anyway
|
|
|
|
|
Hello
To send encoded bytes array...
byte[] MyBuffer = Encoding.UTF8.GetBytes(textBox1.Text);
MyPort.Write(MyBuffer, 0, MyBuffer.Length);
...and reverse the process on the other side.
Regards
|
|
|
|
|
lo, thx for the tip,
but i dont know how to reverse it :s
|
|
|
|
|
no need to bother i found the solution :
public Form1()
{
InitializeComponent();
port.Encoding = System.Text.Encoding.UTF8;
}
and it works!
thx for all the help :p now i can start with databases
grz
|
|
|
|
|
I would just like to run my model past the forum and get some comments, hopefully even start a discussion. Convention tells me that I should not catch exceptions unless absolutely necessary, to recover from something, or to add more information. However, I don't like to have too much diversity and permutations of try-catch blocks etc.
An example is a recent project, with a UI and a class library. The class library exposes two methods used by the UI, and a custom exception class (UpdateException). The library performs database updates that must be rolled back if any is not successfull. Deep inside my classes, I only catch one exception, which masks a real cause of failure, and rethrow adding a description. In the actual update public method though, I catch all exceptions because any exception should cause a rollback. I then throw my UpdateException for the client to catch.
In this way, my client can maintain normal operation after an UpdateException, maybe even try the update again, but respond differently, if at all, to all other exceptions.
|
|
|
|
|
You might want to look at the Enterprise Library Exception Handling Block. Using this will provide consistent handling and give you the ability to easily configure and log exceptions, without changing your code.
only two letters away from being an asset
|
|
|
|
|
I have an am thanks, but I was thinking in a more general manner. I consider some applications a bit small for all that, but then maybe I should put so much thought into their error handling, no?
|
|
|
|
|
How large must an application be before defensive, secure programming techniques are utilized?
only two letters away from being an asset
|
|
|
|
|
Ouch, you are right. Maybe I shouldn't have added the last bit; it was late and I was tired.
|
|
|
|
|
Hello,
how can I convert int[] array to object[] array? I have written a method that compares two arrays and takes (object[] FirstArray, object[] SecondArray) as input arguments.
If I pass string[] arrays as arguments, it works fine, but if I pass int[] array, compiler reports an error "Cannot convert type 'int[]' to 'object[]'".
Example code:
string[] StringArray;
int[] IntArray;
object[] ObjectArray;
ObjectArray = (object[])StringArray;
ObjectArray = (object[])IntArray;
I thought that by converting from int[] to object[] I am doing a standard boxing operation. How can I resolve this?
Thanks much,
Michal
|
|
|
|
|
object[] ObjectArray = new object[IntArray.Length];
IntArray.CopyTo(ObjectArray, 0);
"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." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanks, but this doesn't solve the problem of a method that takes object[] as a universal argument. Why string[] is compatible to object[] while int[] is not? It's not too much elegant to always convert int[] to object[] by using CopyTo before passing the parameters to the method. There must be some more conceptual way.
Thanks,
Michal
|
|
|
|
|
michal.kreslik wrote: Why string[] is compatible to object[] while int[] is not?
string and object are reference types (defined as class ) whereas int is a value type (defined as struct ). Obviously it's not possible to simply cast an array of value types to an array of reference types. I guess that's due to the necessary boxing of array items.
I agree that the use of CopyTo isn't the most elegant solution but I think there's no other way when dealing with value type arrays.
"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." - Rick Cook www.troschuetz.de
|
|
|
|