|
The normal way to do this (a la Outlook) is to display 12 of the calendars.
|
|
|
|
|
Thanks Pete,
That was my thinking, though with the standard monthcalendar it can be expanded to show the 12 months and i was just wondering if this could be applied with the added customisation
|
|
|
|
|
Hi i have given an URL say http://www.mysite.com/x.pdf
now i have to download this file [x.pdf] on the server through C# code.
can any one help me in this regards?
|
|
|
|
|
Open a webrequest and download it.
WebRequest myWebRequest= WebRequest.Create("http://www.mysite.com/x.pdf");<br />
Stream newStream = myWebRequest.GetRequestStream();
only two letters away from being an asset
|
|
|
|
|
Hi guys,
this is the situation:
-i use a OpenFileDialog to get .doc files
-the file wil be saved into sql server table
-with a another button i can load that file from sql and open it with MS Word.
-the file wil also be saved in a directory on the disk. where to save? the path wil be read from config.xml that is located on the 'release' folder of the application(by loading of the form).
the problem:
- when u load the form for the first time, it works fine.
- bud the second time i dont know why bud the app trys to load the config.xml from the folder where i got my .doc file.
for example suppose that the last time i got a .doc from My Documents folder then i get the error:
Can't find C:\Documents and Settings\Me\My Documents\Config.xml
if from C:\ :
Can't find C:\Config.xml
bud the config.xml is located on release folder and this is the code to load the xml:
XmlDocument configfile = new XmlDocument();<br />
configfile.Load("Config.xml");
anyone a idea how to solve this?
|
|
|
|
|
Hi, if you use relative file paths, you rely on the value of the "current directory",
but this one may change, e.g. when switching directories in an Open/SaveFileDialog
(unless some properties prevent that).
It is best to use absolute paths to access application files such as config.
You can calculate the absolute path starting from system information such as the
current directory at app start, or Application.ExecutablePath
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.
|
|
|
|
|
Hi Luc Pattyn,
Thanx for your reply, it realy helped
|
|
|
|
|
Graag gedaan.
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.
|
|
|
|
|
Hoi,
Nog es bedankt en ik heb jou een mailtje gestuurd. Zou je die even lezen aub!?
Groetjes.
|
|
|
|
|
Djavid j wrote: Hoi,
Nog es bedankt en ik heb jou een mailtje gestuurd. Zou je die even lezen aub!?
I'm sorry, but you seem to have got your keyboard a bit jammed up here. Perhaps you could keep this board operating in it's default English only setting. Anything else causes the hamsters to go into attack mode.
|
|
|
|
|
That is the whole idea, gremlins make the site run faster.
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.
|
|
|
|
|
Luc Pattyn wrote: gremlins make the site run faster.
Screaming in terror I assume.
|
|
|
|
|
I presume your config file is in the same directory as the executable? Do you tell it this, or does it just "find" the file the first time?
The issue here is that you're relying on the config being in the applications "current" directory (which it is on startup, since the current directory is defaulted to the exe's folder)
When you use OpenFileDialog it changes the current directory to the location of the file you browsed to, meaning the config can't be found any more.
My suggestion would be to use System.IO.GetCurrentDirectory[^] on startup, and use this when loading the config.
e.g. something like:
m_ApplicationDirectory = System.IO.GetCurrentDirectory();
m_Configfilename = m_ApplicationDirectory + "Config.xml";
...
XmlDocument configfile = new XmlDocument();
configfile.Load( m_Configfilename );
|
|
|
|
|
Hi i'm new in remoting and since that have any common question about
1) How i can understand in server part what some client is expired on client part(detroyed by gc)
2) How my client (on client part) can understand what server is no longer exists (i.e. remote instance of this client to what one delegate ones calls no longer exists)???
TANHK A LOT
|
|
|
|
|
I have never seen either happen but it seems likely that Exceptions would be thrown in both cases
|
|
|
|
|
Good morning,
Say I have various types of messages to send across the network, but obviously I can only send them as an object. How do I filter where the various messages are sent when they get to the server?
I've been going around in circles, and the obvious way (in my head) to handle this is to have some sort of header (using an interface), and then do a switch depending on what's in the header, and cast the object to the specific type.
But something's telling me this is a bad way of doing it, it doesn't feel very OO. any suggestions?
Alex
Sorry if this is in the wrong forum
|
|
|
|
|
I am building a C# control for charting and i want to implement zooming functionality in it. After hitting zoom button in my control, i want to show new form with ennlarged selected area. For this, i need to get data from usercontrol into a new window form. Please tell me how to access data from usercontrol into windows form or is there any other way to implement zooming functionality?
Thanking in advance......
Dhok
|
|
|
|
|
If you are already displaying the chart using the System.Drawing.Graphics , you can use a ScaleTransform[^] for zooming. The two parameters to the ScaleTransform method are the amount of scaling to be done along the x and y axes, respectively.
|
|
|
|
|
Hi,
i'm using the windows media player as activeX object in a C#
application. I want to change the "Video border color"
(Windows Media Player->Menu Tools->Options->Performance->Advanced)
in my application. I cannot find the right options in the msdn library
to change the color from my application.
It's because i want to change the background color of the media player
if a video is changed during playback.
Can please someone tell me how to to this?
regards,
Lucas
|
|
|
|
|
Hi
I was wondering if there are any way to count the occurences of a bitpattern within a textstring using C#. If ANYONE can help me out with this one I would be eternal grateful.
For instance. If I have the text in a string named str1, I want to check this for every occurence of 11's or perhaps 00's.
|
|
|
|
|
int pos = str1.IndexOf("1");
int pos = str1.indexOf("1",5)
A combination of those two methods should have you finding each occurance of 1 (or 0) in no time
|
|
|
|
|
I think you misinterpreted my question. I am not after every occurence of the letter "1" but the bitpattern...like one letter is 8 or 16 bits.
|
|
|
|
|
If you want to search for a particular bit pattern within a string, you will first need to convert string to a byte array, this can be done using System.Text.ASCIIEncoding object.
After converting string to byte array we may search this array for a particular bit pattern. Following is a code snippet which will give you some idea about this-
---------------------Code Start-------------------
byte[] bytes;
byte pattern1 = 111;
string str = "hello there how are you";
System.Text.ASCIIEncoding getencoding = new ASCIIEncoding();
//convert string to byte array
bytes = getencoding.GetBytes(str);
int i;
for (i = 0; i < str.Length; i++)
{
if (bytes.GetValue(i).Equals(pattern1))
{
MessageBox.Show("");
}
}
------------------------Code End---------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
But if I have a byte with 8 bits and another consecutive byte with another 8 bits, how can I check this entire range (16 bits) for only a 11 at any location?
for instance:
11000000 00000000 = 1 time
01110000 00000000 = 2 times
etc...
there is no fixed number representing the 11 since it can move around the byte...
|
|
|
|
|
i guess the crude way would be:
convert your pattern from byte [] to bool []
store the sequence you're searching for as bool[]
loop through the sequence until you match the first value then check the second value of the sequence etc. This isn't going to be quick but it'll work OK for short strings
Russ
|
|
|
|