|
Because it's the application which needs to send emails, not the user. E.g. crash reporting emails or some such.
It looks like the solution does have to do with appSettings though; I'm not quite clear why it works (i.e. why can't I just rename hisprogram.config to myprogram.config, and in myprogram.exe run the code that reflector shows me is necessary to retrieve the setting), but apparently it does. I think.
-Domenic Denicola-
|
|
|
|
|
Hello friends,
I am developing an windows application using C#.NET and i am facing a problem in Copy to clipboard.
I want to copy label along with its caption as a image and that can be paste to MS word..
So how can i do that....
Thanks
|
|
|
|
|
A label IS a caption, isn't it ? So, I guess you can either use the label's DrawToBitmap method or some other way to create a bitmap, if you must have a bitmap, not a string, and then put that in the clipboard.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All,
I've just read this article on the Microsoft site:
http://msdn2.microsoft.com/en-us/library/f177hahy(VS.80).aspx[^]
Which is basically saying that at design time you can check functions. I have a really simple function that takes a string containing a file path and strips out any characters I don't want to deal with like underscores and hyphes. Its called StringToClean() it takes a file path in and spits out a cleaned string ... no biggy.
but typing:
?StringToClean("G:\The_string")
in the immediate window errors with "unrecognised escape sequence".
I'm doing (as far as I can tell) exactly what the Microsoft page says to do ... i'm confused, any ideas?
Thanks,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
In C# (and most languages) the backslash '\' is the escape character, which allows for special characters like newline '\n' or tab '\t'.
So, you either need to ignore escape characters by adding '@' to the begining: StingToClean(@"G:\The_String") or just double the backslashes:
StringToClean("G:\\The_string")
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Hi There,
my method is:
public static string CleanTheString(string stringtoclean)
{
stringtoclean = stringtoclean.Trim();
stringtoclean = stringtoclean.Remove(1, 3);
stringtoclean.Replace("_", " ");
stringtoclean.Replace("-", " ");
System.Diagnostics.Debug.WriteLine(stringtoclean);
return stringtoclean;
}
but doing this;
?CleanTheString(@"G:\The_string") ends up with this error:
The name 'CleanTheString' does not exist in the current context.
I tried removing the 'public' from the constructor and that doesn't change the result. Also I keep reading that intellisense should work in here but that doesn't work for me either.
Shame, it seems like this window could be seriously useful if I could only work it out.
Any ideas?
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Since your method is a static one, perhaps prefacing it with the name of the class it is in will work for you.
Something like this in the immediate window should work:
? MyClass.CleanTheString("G:\\The_String")
Jammer wrote: Also I keep reading that intellisense should work in here but that doesn't work for me either.
I have not been able to consistenly get Intellisense to show up in my immediate windows. It is very odd behaviour. Sometimes it will work for me, others it won't. I can't exactly find out why...
|
|
|
|
|
Hi J$,
I've tried that already ... and made sure that the correct project is selected in the VS list of projects in my solution.
This is the second time I've taken a stab at using the immediate window ... I gave up the last time and it looks like i'm on that same road again. I'm doing *exactly* what all the blogs/articles say that I have read. I can't see a single problem with what I'm doing ...
Is this possibly a VS2008 Beta 2 issue?
I've read quite a few people having problems with the intellisense in the immediate window. At least they can get something useful out of this feature. Its never worked for me either here now at home, or at work ... yet people rave about it. I'm a bit gutted to be honest.
Jammer
Going where everyone here has gone before!
|
|
|
|
|
OK, this may sound like a stupid question, but when you're trying to use the immediate window, you ARE debugging/running your application right?
Jammer wrote:
Is this possibly a VS2008 Beta 2 issue?
I'm not sure I can really give you any insight into that, as I currently use VS2005.
|
|
|
|
|
hehe ... indeedy!
Actually this is working without running in debug mode ... just at design time (which is how I had read it worked ... lots of experimenting to do now!
Making changes in the source code and re-running the immediate window code doesn't consistently force a recompile here which means you end up testing it against an old build which isn't what I've read online.
Anyway, its all working now sort of as expected too!
wooo!
Thanks chap.
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Hmm ...
And no sooner than I say that it throw out something useful!
OK ... I have now selected the project in my solution that is the startup project (that builds the .exe) then running this:
? DataLayer.FileCategoryStringCheck.CleanTheString(@"G:\The_string")
chucks out the result of CleanTheString() seems like a bit of an odd way around, wouldn't it be nice if it just looked at the currently open class as well as following this code path through the solution???
Still at least I can quickly debug the methods now ... I can see a **** load of opportunity for using this quick and dirty debugging malarky.
yay!
Thanks for all the help!
Jammer
Going where everyone here has gone before!
|
|
|
|
|
This answer has probably already been answered but after thorough searching I couldn't quite find what I was looking for. Anywayz the problem is as follows....
I have created a server and client program connecting through the use of sockets...
Now the client will connect with the server (which is already running) and send a file... After quite some testing on same-PC basis I tried it across the internet. A friend of mine is connected in a LAN having her IP like this: 192.168.2.102 . Now, when I run the server and the friend runs the client it all works fine, but not the other way round!
Obviously asking my client to connect to the friend's server 192.168.2.102 is useless since it's only an internal IP. After revealing the friend's external IP from whatismyip.com it seemed like I could solve the problem, but the server refuses to connect with the error below:
Unhandled exception occurred: The requested address is not valid in its context
Is there a way to solve this error? Please help!
|
|
|
|
|
Well, i only did this once and connected from the web, to my home network. Then to get it to connect to the right PC i had to put port forwarding on the router to send the connection to the right place. So its a bit of a pain connecting to a computer from outside the local network.
The best answer i could find to the problem was to have a web server that both PC's connected to and then have the web server connected them.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Hi, i have a windows application. I don't want it to look like the normal XP. For example i wish that it always looks like vista or it is always olive green. How can i make my program with it's own theme?
|
|
|
|
|
By owner drawing everything or if it's just colors you want to change, by setting the colors of all the controls on the form, and the background color of the form itself.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Hi All,
I'm just looking into what's the best route and thought i'd ask here. The format of the dictionary/list/array I'm going to be using is:
Unique Key (string)
score (int) (intially all zero)
I'm then going to be comparing a string to a lookup table and based on that result i'll find the correct string in dictionary/list/array and increment the score accordingly. Once that has been completed i'll sort the dictionary (sorteddictionary?) based on the score and depending on the ascending or decending sort order grab the string from the dictionary and then reset each score (int) field ready for the next scoring process.
What's the best type to use in this scenario? In terms of size there are only around 15-20 possible unique keys so I guess performance isn't too critical but its going to be repeatedly used sometimes 400 times+ before the user will see the results ...
Cheers,
James.
|
|
|
|
|
A dictionary should be fine for these purposes.
|
|
|
|
|
Hi Peter,
Thanks for that ... so grabbing an int from the dictionary incrementing it and stuffing it back in is all doable and a good route to take with this?
Cheers,
James.
|
|
|
|
|
Sorry - I missed that requirement. It's ok if it's not the key - otherwise you are going to be doing a lot of deleting/creating.
|
|
|
|
|
Gotcha! No its not going to be the key its the value (int) that is held in the dictionary against the key.
so for instance.
Key = Blah
Score = 0
If I find a Blah the score held against Blah = score + 10
etc ...
blah blah ..
|
|
|
|
|
Also have a look at SortedList, it is a sorted dictionary!
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.
|
|
|
|
|
Ahhhh ... now that sounds really interesting! Thanks for the tip!
Jammer
|
|
|
|
|
I have a situation where I have a panel inside another panel (we'll call them innerPanel and outerPanel). outerPanel is anchored on all four sides so it expands and contracts with the window. outerPanel also has the AutoScroll property set to true.
If I put innerPanel inside outerPanel and anchor it left, right, and top then when I make the window very short scroll bars appear on outerPanel. However, innerPanel's height will not expand when I expand the window. This is what I expect to happen.
If I set the anchors on innerPanel to all four sides it expands and contracts with the window. However, sometimes innerPanel shrinks too small to see it's contents. This is the behavior I expect.
Now, if I set a minimum width on innerPanel and anchor to all four sides it will expand with the window like I want, but when I reach that minimum size innerPanel just gets cut off, the scroll bars never appear. This is absolutely not what I expect.
Am I doing something wrong? I want innerPanel to expand freely in all directions and contract to a minimum size, then if it's container is too small for innerPanel I want scroll bars to appear.
Obviously the simple solution here is to set AutoScroll to true on innerPanel and anchor it to all four sides, but in my real application there are several innerPanels and it would look ridiculous to have seven scroll bars on the page.
Thank you in advance.
|
|
|
|
|
Hi,
if anchors, docking, autosize and what have you, don't perform as you would like them to,
there is a straightforward solution: don't use them at all, and write some code instead,
in the OnResize method of the relevant panels. That's what I used to do from day one, until I
discovered some cases (particularly the simple ones) could be solved by setting anchors and so.
The advantage is you can make it do whatever you can come up, you don't have to fight the
built-in functionality, not even read the documentation...
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.
|
|
|
|