|
Nick Parker wrote:
A server error of 500
A server error comes from the server. IIS is running.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I wrote:
A server error of 500 could mean it can't contact IIS.
I guess I should have said, an error processing on the server, not contacting. Sorry, long day with a headache. I forgot to tell you what happened two nights ago when I went to the YMCA. I will send you another email.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi all!
Sorry for the supernewbie question!
I'd like to convert the pixel format of in image in System.Drawing.Bitmap to
16 bpp grayscale but PixelFormat property is set as readonly..
Is there an easy way to do this conversion?
Thanx in advance!
Marco
L'attimo della vita di un uomo dura la storia
-Marco Valkamonici-
|
|
|
|
|
|
I am creating an app that has the user select several email addresses.
what i am looking to do, it to be able to take the string of emails (it is a web app, and the way the email string looks is "1@email.com 2@email.com 3@email.com". What i need to be able to do is break that string apart into:
arrayitem[0] = "1@email.com";
arrayitem[1] = "2@email.com";
arrayitem[2] = "3@email.com";
any ideas?
|
|
|
|
|
Okay, I hadnt signed in when i posted this
please send responses to this
Yes, I am the highly suggestable type.
|
|
|
|
|
You didn't specify what what delimited your email addresses but it looked like a new line character. The following method will do this for you.
private string[] SplitEmailAddresses(string addresses)
{
string[] emails = addresses.Split(Environment.NewLine.ToCharArray());
return emails;
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
If you have a consistent delimiter, and it looks like a space character for your example, you can use the Split method of the string object to create the array. It would look something like:
<span style="color: Blue; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">string</span> source <span style="color: Red; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">=</span> <span style="color: #666666; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">"1@email.com 2@email.com 3@email.com"</span>;
<span style="color: Blue; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">string</span>[] array <span style="color: Red; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">=</span> source.split(<span style="color: Blue; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">new</span> <span style="color: Blue; font-family: Courier New; font-size: 11px; background-color: #FBEDBB">char</span>[]{' '}); Hope that helps a bit.
--Jesse
|
|
|
|
|
Cool, i will give them both a try. Thanks!
Yes, I am the highly suggestable type.
|
|
|
|
|
BEAUTIFUL!
Worked like a charm, guys, thank you
|
|
|
|
|
Hello,
Can someone give me a hint how to intercept HTTP headers in IE?
I need to write BHO or something to monitor and modify http traffic processed by IE (need to block Set-cookie depending on domain). I cannot use external proxy.
Thanks
|
|
|
|
|
The privacy features of IE6 already support that. Just add the domain (like doubleclick.net) to the list of sites to block. This is persisted in the registry under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\P3P\History. Add a key for the domain and set the default value (as a REG_DWORD) to 5 to always block.
IE (i.e., the WebBrowser control) actually doesn't have anything to do with the HTTP request/response mechanism, so a BHO won't help. That is handled by urlmon.dll, the URL moniker (among other things). There is some communication between the two, but nothing you can really hook.
Consider this: with all the popup blockers and add blockers, why have you probably never seen a cookie blocker (the other two are coupled with the WebBrowser control and the MSHTML DOM so are well within the scope of Internet Explorer)?
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Anyone know of a program that will take the XML output from the /doc (Process Documentation Comments) option and convert it into an HTML or help file?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
My vote goes to NDoc[^].
Hope that helps a bit.
--Jesse
|
|
|
|
|
|
Excellent. Thanks.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi,
How can I check for an Empty Dataset after calling filled property in DataAdapter.
Can I use
if (dsEmployee == Null)
will this work?
Thanks,
JJ
|
|
|
|
|
An empty DataSet isn't null. A DataSet variable is null when it reference nothing. There's a big difference.
If you want to determine if a DataSet is empty, you need to enumerate the tables and get the count of each table. This is the only way to account for both types of DataSet s - typed and untyped (generated by a DataAdapter , for example):
public bool IsEmpty(DataSet ds)
{
if (ds == null) throw new ArgumentNullException("ds");
foreach (DataTable dt in ds.Tables)
if (dt.Rows.Count > 0) return false;
return true;
} Optionally, if you want to treat a null reference as an empty DataSet (not really a good idea, but it's up to you), then replace the first line with something like if (ds == null) return true; .
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi,
I have a Windows Form, which has multiple ListBoxes, being populated by data on FormLoad Event, and a Button to run the query. onClick of the button, I want to get all the selected values from the ListBoxes and form a Query String, with commas in between values, How can i Do That ??
Any help is appreciated.
Thanks,
Abhi
|
|
|
|
|
That really a fairly simple problem. You can get one or multiple values using ListBox.SelectedItems . Enumerate that property collection to get values. For each ListBox , you do this again. How you construct the query is up to you, but string concatenation, String.Concat , StringBuilder.Append , and many other ways can help you.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
C# WinForms - DateTimePicker (VS 2003)
I have certain dates that are valid – can be non-contiguous(1,
5,13,17,22 of Aug’2004) or a continuous date range (10 – 17 Aug 2004). I need to
Disable the invalid dates – so that user may not choose unlisted
dates.
Visually show that these dates are not available (different fore
color, back color, or strike out font style etc)
Things that already tried. – Setting Min/Max date: works fine if the valid date range is continuous – user is then not able to click on invalid dates that are out of min/max range – but visually there is no indication and the user thinks the calendar is not working fine. Unable to set CalendarFont strike through for selected dates once the calendar dropdown occurs.
|
|
|
|
|
You need to customize the Month Calendar Control, actually. One way - perhaps the easiest - is to derive a class from DateTimePicker , like CustomDateTimePicker or something.
Define a property or properties to reflect MonthCalendar.AnnuallyBoldedDates and MonthCalendar.BoldedDates (depending on if you want dates reoccurring per year). You'll actually declare fields to store these values however:
private DateTime[] annuallyBoldedDates;
private DateTime[] boldedDates;
public DateTime[] AnnuallyBoldedDates
{
get { return annuallyBoldedDates; }
set { annuallyBoldedDates = value; }
}
public DateTime[] BoldedDates
{
get { return boldedDates; }
set { boldedDates = value; }
} Override OnDropDown and get the handle to the MonthCalendar and set its properties accordinly control like so:
protected override void OnDropDown(EventArgs e)
{
base.OnDropDown(e);
MonthCalendar mc = GetMonthCalendar();
if (mc != null)
{
mc.AnnuallyBoldedDates = annuallyBoldedDates;
mc.BoldedDates = boldedDates;
}
} You need to define GetMonthCalendar , though. This handle is only valid for that drop down, so you don't want to keep a reference to it. This is documented in the Common Controls documentation, which almost all of the Windows Forms controls encapsulate.
You could define what you need like so:
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
private const int DTM_GETMONTHCAL = 0x1008;
private MonthCalendar GetMonthCalendar()
{
IntPtr hWnd = SendMessage(this.Handle, DTM_GETMONTHCAL, IntPtr.Zero, IntPtr.Zero);
if (hWnd != IntPtr.Zero)
return Control.FromHandle(hWnd) as MonthCalendar;
} Read the documentation for MonthCalendar.AnnuallyBoldedDates and MonthCalendar.BoldedDates for more information.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks Heath
That's exactly the approach I took after posting this query. Initially I kept struggling with the DateTimePicker – but realized the stuff that I need is actually possible in MonthCalendar. So now I’m, using Label Control to display the date range, OnClick of Label will show the MonthCalendar with all the Valid dates in BOLD. And still have the Min / Max dates so the user may not be able to click unwanted dates.
|
|
|
|
|
Hi,
I have a winform based user control and host it in IE using object tag. How do I hook up custom events exposed by the control via jscript. Is it possible?
Note: it is a winform based control, not an ASP.NET server control.
Thanks
|
|
|
|
|
Could you give an example of what events you are trying to hook up?
- Nick Parker My Blog | My Articles
|
|
|
|