|
In my scenario I was:
1. Still using .Net 1.1.
2. Mostly doing C# to VB snippet conversions.
In this scenario, the developerfusion site was adequate enough.
I had been doing C# for a few years before having to work on a VB project.
It would be nice if you could get yours to do snippets though because often we see articles in one language, where we just want to convert a few lines or a method. Often there isn't a full compilation unit presented.
Kevin
|
|
|
|
|
|
I am trying to store strings with embedded escape characters in a resource file, for example:
An error occurred:\r\n{0} However, when the string is retrieved, the escape characters are not read correctly, and I end up with a string such as this:
An error occurred:\\r\\n{0} which is not terribly useful.
According to this[^] article, I can call
String.Replace( "\\r", "\r" ); on the string, but this seems a little silly...
Is this really the "standard" way of storing and managing escaped strings or am I missing something fundamental here?
|
|
|
|
|
|
It's not the escaping characters I'm having a problem with - it's the fact that I can't load them from a resource file without losing the fact that they're "special" characters.
For example, the newline character (\n) becomes two characters, a slash and the letter 'n'. I could run String.Replace on the string to turn it back to something useful, but it shouldn't be translating my string in the first place. Besides, running String.Replace just seems like a huge hack.
VC++ 6 could store and retrieve escaped strings from resource files with no problem, but I can't seem to get it to work as expected in Visual Studio 2005.
|
|
|
|
|
It is not translating your string - it is returning it unaltered. How should it convert \n into newline when it has no idea which programming language you are loading the string from? Not all languages use \n for newline.
Place a newline in the actual XML value. It should work from a technical point of view, but expect to loose it in translation (as in translate to other human languages, not escaping/unescaping). Hard coded newlines really do not belong in anything that should be translated, Make a resource for each line/paragraph instead, or calculate the newline position at runtime.
|
|
|
|
|
hi.
I'm making a contact us form with asp.net 1.1 & C# .
the form has textbox which people can type their name,email and message ...
then they click the "send" button.
I want to recieve their message and name and email in my inbox not in my database!
because I have written the code which can save the message in the database.but it doesnt the thing that I want.!
I want to recieve their message and name and email in my inbox( I mean my email address inbox ).
So,please tell me how to do it ?
thank alot
|
|
|
|
|
You can use the System.Net.Mail.MailMessage class to send yourself an email with all the relevant user contact info as demoed here[^]
|
|
|
|
|
hi 4 all
i need help from any one to scan image from scanner and insert it into database
scanning must done from application.
** Run my program , when i click "scan botton " scanning image and view it And save it to database
thank you 4 all
-- modified at 21:53 Friday 11th May, 2007
|
|
|
|
|
I have Form, and with a button, it launches a second form. I want the second form to "stay with" the first form. On top of it, in fact. But, not on top of everything else. Does any of this make sense? This is not MDI...
I've exhausted Google -- it's tired of me search for different variations of "form, window, child, parent, etc...".
Thoughts?
|
|
|
|
|
In your parent form, do this to create the child:
Form f = new Form();
f.Owner = this;
f.Show();
I hope that's what you were looking for
|
|
|
|
|
That was it. Thank you very much.
|
|
|
|
|
Hi friends, I am indeed in a hurry to get this thing done. I have a multi culture resource file
myResource.en-US.resx
myResource.fr-Fr.resx
I used the tool named ResXFileCodeGeneratorEX it works fine but when i tried to use multi cultural resouces I don't get the code behind means there is no code behind. But if I use the use the regualr resource file like myResource.resx the tool works completely fine and I do get all the properties public defined.
Could somebody show me how can I defined all the resources "Public" in a multi-cultural resource files.
I will appreciate thanks in advance
|
|
|
|
|
I am having a weird problem while validating an XML file against its schema. I am setting XmlReaderSettings to xml schema, add the ValidationEventHandler and then create the xml reader. But it throws an exception:
------------------
A first chance exception of type 'System.Xml.Schema.XmlSchemaValidationException' occurred in System.Xml.dll
validate function threw an exception of type 'System.Xml.Schema.XmlSchemaValidationException'
base {System.Xml.Schema.XmlSchemaException}: {"It is an error for both 'length' and either 'minLength' or 'maxLength' to be members of {facets}, unless they are specified in different derivation steps. In which case the following must be true: the {value} of 'minLength' <= the {value} of 'length' <= the {value} of 'maxLength'."}
SourceObject: null
-----------------------
I have validated the same xml file against the same schema using Oxygen XML Editor and XML Spy and these tools consider it a valid document.
Now after that I opened the schema in VS 2005, it underlines the xsd:length attribute and tootip gives the same error. But the above mentioned third party tools consider it valid attribute.
Any thoughts will be highly appreciated
-----
-----
|
|
|
|
|
Hi all,
I'm trying to copy a feature thats in Outlook. In the To field when creating a new email, if you type in an email address that you have used before, it will automatically display it and allow you to press enter.
Once you have done this, if you click on the email address, it selects it as a block and not as a piece of text. If you double click on it, it shows you information on that email address.
I am building an application for internal requests and would like the user to be able to type in the User's name in which the request is for, and on leaving the textbox, it will check the typed in User's Name and if it matches then it does what I described above, turns into an object and when you double click on it, it will show that users information.
I've played around with a Rich Text Box, and i've managed to get it to underline all the User's Names that are correct, but if I click on it, it will act as if its text (of course) and if the user continues typing it remains underlined.
Any idea's?
TIA
Gav
|
|
|
|
|
|
Well, I've been wrestling with a problem for a little while now and feel like I'm banging my head against a brick wall. Basically, I want to be able to generate code from a string that can refer to a current instance member. This would mean that I would need to be able to inject it into the current instance.
Specifically I'm trying to attach the code to an attribute. Initially I attempted to do this with a delegate, but you can't attach delegates to attributes (which makes sense when you stop and think about it).
Consider this example:
SomeClass.Generate("return (this.Name != null && this.Name.Length.Trim() < 20);"); I've looked at the CodeDOM and I've looked at Reflection.Emit and I can't seem to find a way to do this.
If anybody else has attempted this, I would be really interested to hear how they managed it or if (as I'm starting to suspect) this is impossible.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You're gonna have a hard time doing this without expression trees, I think. The code compiler in CodeDOM won't work because the code you posted there won't compile (this.Name is unknown).
I suspect you're doing this for some kind of argument validation, in combination with some verification/static analysis tool? If so, you might want to check out Spec#[^]. They've got a C#-compatible mode where you can type verification using special comments, then verify this with their Boogie tool.
|
|
|
|
|
You're right about what I'm trying to achieve. There were various options for what I want to do, but I really want to put this in the attribute. Oh well.
The research on spec# is interesting though.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yeah, it's a shame attributes can't have non-compile time values. I recently hit this problem[^] with MbUnit test framework for argument validation tests.
I've thought about this problem as well regarding argument validation in your real code (as opposed to just unit testing); seems it's pretty impossible to do currently, outside of boil-the-ocean schemes like aspect-oriented programming's method call interceptions. What we need is language extensions for specifying pre- and post-conditions, ala Eiffel[^]. Spec# does this by adding some new keywords to C#, such as ensures and requires . However, if you can't make the Spec# plunge, you can simply add special comments to your C# code, then run their static analysis tool on your C# code to make sure the contracts are enforced.
I'm looking forward to C# 4. Then we should have some good support[^] for pre- and post- conditions, pure methods, immutable types, non-null types, and invariants, alleviating the need for things like validation in attribute strings. Hopefully they throw in some good multi-threading abstractions too.
I'm wondering if LINQ could do anything in the form of expression trees to help us out here with some kind of Linq To Validation[^].
|
|
|
|
|
Well, to turn a string containing C# code into IL, you obviously need a C# compiler. As the Microsoft C# compiler only compiles full assemblies, you cannot use it for light-weight code generation, especially if you want "this" to mean something else.
You could write your own C#-like compiler by using a C# parser like NRefactory[^], then converting from the parser's AST to CodeDOM (NRefactory contains a class that can do this conversion for a limited number of cases, it is used in SharpDevelop's form designer to load InitializeComponents() contents into a CodeDOM statement list), and letting CodeDOM compile it.
|
|
|
|
|
Thanks for the information. I'll take a look into this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How to Produce a menu-driven application that uses accept statements and variables.
And also tell me what is accept statement and veriables
|
|
|
|
|
Looking at your message history, all of your message titles are please or urgent. Please read the forum guidelines and name posts appropriately.
This message is very vague. If you google what you are looking for, read about it, come back and ask a more specific question.
__________________
Bob is my homeboy.
|
|
|
|
|