all groups > c# > may 2007 > threads for wednesday may 23
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
custom attributes in .Net 2.0
Posted by windsim at 5/23/2007 11:58:01 PM
Hi,
I have a custom attribute targing Property:
[AttributeUsage(AttributeTargets.Property, AllowMultiple=false,
Inherited=true)]
public class StatefulPropertyAttribute : Attribute{}
and all the properties marked with [StatefulPropertyAttribute] will be
handled by
public System.Comp... more >>
Can someone translate this to vb.net?
Posted by raz230 at 5/23/2007 8:51:29 PM
I'm sorry for posting this here-
I have to integrate an parcel tracking with Canada Post into one of my
applications. The web service they use is made with SAP and is not
the usual WSDL type of service I am used to. I cannot just add a web
reference to my project and get going.
Canada Pos... more >>
How do I stop my software from getting cracked?
Posted by i at 5/23/2007 5:54:46 PM
Hi,
I have benefited from a profitable idea for a stand-alone program that
I've created in C#. Up until recently, my method of licensing hasn't
been touched. I base authorization on user accounts, and the program
sends and receives RSA encrypted data in order to determine whether or
not the... more >>
Printing images utilizing entire paper area.
Posted by Frank Rizzo at 5/23/2007 5:31:15 PM
I am trying to print huge images (much bigger than target paper). I try
and use e.PageSettings.HardMarginX and e.PageSettings.HardMarginY in the
PrintDocument's PrintPage event to try and determine the maximum area
that I can print on. However, the edge of the image invariably gets cut
off... more >>
Conversion between collection interface types
Posted by satyajit at 5/23/2007 3:24:35 PM
Hi All,
I have a class that has a property returning IList. For example,
class A
{
public IList<string> MyList
{
get { return _list; }
set { _list = new List<string>(value); }
}
private List<string> _list;
}
Now, I have a method that has an IEnumerabl... more >>
multi threading in C#
Posted by Vinki at 5/23/2007 2:57:01 PM
Hello Everyone,
I just started learning Threading in C#. I read lot of articles and what I
am trying to accomplish here is
that I have an array of string and I want to pass the member of that array
to each thread one by one until the processing is done.
how can I pass the values one by... more >>
socket receiveTimeout and sendTimeout properties
Posted by David at 5/23/2007 2:29:42 PM
VS 2005 help says they are only for the synchronous send and receive
methods. So what about the asynchronous calls? How are timeouts handled?
... more >>
Browser Object - NavigateComplete2 event.
Posted by Mufasa at 5/23/2007 2:13:56 PM
So I've got web pages that are going to be loaded that take a little while
to load. Rather than having somebody sitting there staring at nothing while
the page loads, I'd like to put up something and when the page finishes
loading, show them the entire page.
Would this be accomplished with ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Windows Service vs. Windows Application
Posted by greenzrx NO[at]SPAM gmail.com at 5/23/2007 2:06:00 PM
I have the following snippet of code which works both as a standalone
application and as when incorporated to a windows service.
There seems to be a slight difference between the service and the
standalone app however.
We have a legacy VB app which uses ADSI to apply file permissions. I
have ... more >>
Communicating between threads
Posted by bhargavchokshi NO[at]SPAM gmail.com at 5/23/2007 1:56:40 PM
Hi,
I m kind of new to multithreading programming and try to implement one
solution. The problem I have is, I have one background thread which
does time consuming processing. The parent(calling) thread can be
windows application or console application or simple object. How can I
pass message ... more >>
ArgumentOutOfRangeException When I Remove ListView items
Posted by dvestal NO[at]SPAM gmail.com at 5/23/2007 1:32:17 PM
I have a ListView with checkboxes. I want to remove items when the
checkboxes are unchecked, but to do so yields an
ArgumentOutOfRangeException. Is there an easy way to get around this?
A simple program that illustrates the exception is below:
using System;
using System.Windows.Forms;
... more >>
Re: Declaring variables in loops
Posted by Marc Gravell at 5/23/2007 1:31:47 PM
> That was the case before anonymous methods came along
Fair enough Jon - good catch (and one I normally try to spot ;-p) -
but in fairness that doesn't affect the example cited (unless it does
something major in the elipsis).
Marc
... more >>
HttpWebRequest/HttpWebResponse Cookie Problem
Posted by (hyu1337 NO[at]SPAM gmail.com) at 5/23/2007 1:24:30 PM
I've being trying to get a cookie value for a certain site but the
site I have no control over has a comma (",") in the cookie value
and it gets broken down like this when I use the response=
(HttpWebRequest)request.GetResponse.
Name: SESSION_ID Value: 3862511
Name:
y90iM7ucrhW/nFEi8nxHds... more >>
XPathNavigator SetValue wipes out XmlType
Posted by Noremac at 5/23/2007 1:18:03 PM
Hi.
Using VS2005, .NET 2.0.
I have an xml document that I want to go through and set the values on
attributes of elements. The elements are complex types defined in my schema
(xsd) files.
I can iterate the document and get my XmlType and XmlBaseType values just
fine. However, as soon ... more >>
Re: WCF: Why is the client's IDisposeable implementation private?
Posted by Marc Gravell at 5/23/2007 12:58:54 PM
> Does anyone else besides me find this to be unacceptably stupid and messy?
I am 100% in agreement with you; to my view, Dispose() should worry
about any internal details - not me! That being the entire point of
encapsulation and a resource-management interface that is so common
that it has com... more >>
NativeMethods versus SafeNativeMethods versus UnsafeNativeMethods? (reflector)
Posted by kilik3000 NO[at]SPAM gmail.com at 5/23/2007 12:32:24 PM
I've been using reflector to look into some of the core MS .NET
assemblies. I have noticed this pattern in the naming of classes that
wrap p-Invoked Win32 api functions.
I like this pattern.
I'm just curious why are some API functions considered "Safe" and
others "Unsafe"?
Shouldn't any... more >>
Re: How to replace the "\\" char with "\"
Posted by JPS at 5/23/2007 12:20:53 PM
On May 23, 2:10 pm, Chris Dunaway <dunaw...@gmail.com> wrote:
> On May 23, 12:54 pm, JPS <jpsu...@yahoo.com> wrote:
>
>
>
>
>
> > On May 23, 12:43 pm, "Nicholas Paldino [.NET/C# MVP]"
>
> > <m...@spam.guard.caspershouse.com> wrote:
> > > JPS,
>
> > > Did you look at the output? If y... more >>
Re: How to replace the "\\" char with "\"
Posted by JPS at 5/23/2007 12:20:23 PM
On May 23, 12:43 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> JPS,
>
> Did you look at the output? If you use "\\", you will find in the final
> output that there is only one "\". The slash is an escape character for
> strings in C# (unless you use the... more >>
Synchronizing asynchronous HttpWebRequest
Posted by MaxMax at 5/23/2007 11:30:18 AM
I'm using HttpWebRequest. It seems that all the callback called from
HttpWebRequest are in another thread (not in the "original" thread). Now my
problem is that the "original" thread is the thread that maintains the
interface (the forms). I want to signal from the "worker" thread to the main
... more >>
Re: Calling generic method with a T parameter determined at runtime
Posted by Marc Gravell at 5/23/2007 11:22:57 AM
Sorry, but I believe you are wrong; there are huge advantages to this,
especially in a factory scenario.
Just because you Invoke() passing objects doesn't mean type safety
isn't an issue (although obviouslt it is enforced at runtime, not
compile-time).
MakeGenericMethod() still enforces all n... more >>
Re: Declaring variables in loops
Posted by Marc Gravell at 5/23/2007 11:17:12 AM
At the IL level, all variables are declared at the top; there is
therefore no functional difference in this code, other than "x"
remains scoped (to C#) outside of the braces.
Marc
... more >>
Declaring variables in loops
Posted by AL at 5/23/2007 11:06:00 AM
Hi
I usually stick to the convention of not declaring variables in my bodies of
"loops" (including foreach)
ie
int x;
for (int i = 0; i < 10; i++) {
x = ...
}
as opposed to
for (int i = 0; i < 10; i++) {
int x = ...
}
I've heard that in Java declaring variables within loops... more >>
FileSystemWatcher
Posted by Mufasa at 5/23/2007 11:00:12 AM
I have need to be polling a directory for files ( I am going to be using
files to have programs communication between each other - don't ask! )
Anyway - the question I have is what happens if in the middle of processing
something another files comes in. Does the event get interrupted because t... more >>
Re: How to replace the "\\" char with "\"
Posted by JPS at 5/23/2007 10:54:26 AM
On May 23, 12:43 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> JPS,
>
> Did you look at the output? If you use "\\", you will find in the final
> output that there is only one "\". The slash is an escape character for
> strings in C# (unless you use the... more >>
Serialization vs. program updates
Posted by Jesper, Denmark at 5/23/2007 9:45:01 AM
Hi,
Just before I invent my own solution... :-)
I'm developing a program where I use binary serialization of the data the
program holds. Know and then the serialized objecst will be modified, e.g.
with a new field, or perhaps the removal of a field. Depending on the
changes, the program ... more >>
How to replace the "\\" char with "\"
Posted by JPS at 5/23/2007 9:34:02 AM
I need to build a string with just one backslash included "\", but I
keep getting an error message unless I use "\\". The double
backslashes will not work with what I am doing.
... more >>
Re: When is "volatile" used instead of "lock" ?
Posted by Brian Gideon at 5/23/2007 9:22:47 AM
On May 23, 8:08 am, "Ben Voigt" <r...@nospam.nospam> wrote:
> I don't think so, actually. Without volatile semantics, the compiler is
> free to cache the value of any parameter, including in/out parameters. Say
> you are calling an Interlocked method in a loop. If the variable is not
> volati... more >>
PrinterSettings() in csharp
Posted by David at 5/23/2007 9:12:05 AM
I’m not sure how to feed PCL commands (i.e. “Ec&l1Sâ€) thru the
PrinterSettings() function, but we have been successfully using the
PrinterSetting() properties and methods to successfully call on most of the
printer’s properties.
Our understanding was that by using the correct combin... more >>
Detecting a script error in a browser object.
Posted by Mufasa at 5/23/2007 8:51:41 AM
Is there any way to detect if there is an error in a script for a page
through the browser object? Or at least turn it off? I know I can set it
through IE but was wondering if I can do it programtically for my object.
TIA - Jeff.
... more >>
YES/NO: Console.WriteLine use a lot of resources?
Posted by R Reyes at 5/23/2007 8:36:01 AM
does this command use a lot of resources? should i comment them all out
before creating my .exe file? i use it a lot for debugging...
or, does it not make much of a difference?
thanks much
... more >>
Re: Call stack window in C# Express
Posted by Dom at 5/23/2007 8:32:58 AM
Are you sure this is CSharp Express? Because I don't find it there.
Could this be something MS left out of the free Express version?
Dom
On May 23, 11:00 am, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.com> wrote:
> Hi
>
> Is there, and even more is it called the... more >>
Re: need to assign null
Posted by Jon Skeet [C# MVP] at 5/23/2007 8:18:13 AM
On May 23, 3:19 pm, rodchar <rodc...@discussions.microsoft.com> wrote:
> i have a String that i need to DateTime.Parse() and if a FormatException
> occurs I need to assign a null to my DateTime variable. The only way i know
> to do this is DateTime.MinValue or .MaxValue.
>
> Does this still sta... more >>
Re: Call stack window in C# Express
Posted by Dom at 5/23/2007 8:08:33 AM
On May 23, 11:00 am, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.com> wrote:
Are you sure this is CSharp Express? Because I don't find it there.
Could this be something MS left out of the free Express version?
Dom
> Hi
>
> Is there, and even more is it called the sam... more >>
Code Templates(Item/ Project) in C#
Posted by kanepart2 NO[at]SPAM hotmail.com at 5/23/2007 7:51:24 AM
Hey all , I wanted to create a project or item template in C# such
that when I use that template a parameter wizard comes up asking for
values. I know how to create the template without implementing the
wizard, i.e., work the parameter replacement using the
<CustomParameters> keyword in XML.
... more >>
Formated Combo Box
Posted by BD at 5/23/2007 7:50:40 AM
I am running VS 2005 writing in C# accessing remote SQL Server 2005
database. I want to develope a custom listing of the relationship
between Customers and Locations (one to many) in a combo box. The
releation is defined in SQL and shows up in the dataset. I have been
using datagridview and w... more >>
Accessing network PCs
Posted by accyboy1981 at 5/23/2007 7:47:17 AM
Hi,
I'm looking to create a simple application that will copy files from a
folder on one PC on the network to another PC on the network but I am
having a bit of difficulty doing this. The problem is that the network
is not active directory and there is not a common username and
password betwe... more >>
Call stack window in C# Express
Posted by Dom at 5/23/2007 7:29:28 AM
VB had a call stack window (although I'm not sure that's the term).
You could use it to see the chain of routines that brought you to
where you were.
Is there something like this in C# Express? I can't seem to find it.
... more >>
need to assign null
Posted by rodchar at 5/23/2007 7:19:03 AM
hey all,
i have a String that i need to DateTime.Parse() and if a FormatException
occurs I need to assign a null to my DateTime variable. The only way i know
to do this is DateTime.MinValue or .MaxValue.
Does this still stand? And are there any caveats doing it this way?
thanks,
rodchar... more >>
maximize off screen
Posted by randy1200 at 5/23/2007 7:09:00 AM
I have a Winform (Composite UI Application Block) application that works great.
Users have discovered that double-clicking any window title bar in Microsoft
Windows XP is the same as clicking the Maximize/Minimize button. This works
with Microsoft Word, the My Computer window, and my Winform ... more >>
how can i know column have identity true in runtimes
Posted by Neeraj at 5/23/2007 6:44:54 AM
Hi all.
I have stuck at a strange point.in Database some master table have
identity column and some havenot. Then How can i know at runtimes that
which table have identity column.
According to this i have to write query string.
I got dataset from table.
and
write
ds.Tables[0].Columns[0].... more >>
Are Regex slower than methods from classes like String & Char?
Posted by ommail NO[at]SPAM wp.pl at 5/23/2007 6:27:00 AM
Hi
I wonder if regular expressions are in general sower than using
classes like String and
Char when used for validating/parsing text data?
I've done some simple test (using IsMatch()) method and the result was
that Regex
is either as fast or two times slower than method which used methods... more >>
How to extract filename information from running processes ?
Posted by adimangla at 5/23/2007 6:18:14 AM
Hi :-)
I am creating a software that will save the present state of all the
applications running on the desktop (WinXP).
Can anyone point out the method to extract the filenames from the
handles (or otherwise) of the files that are being accessed by
processes and programs ?
For example : I... more >>
pinvoke structure marshalling with embedded fixed strings... I'm going mad
Posted by Beorne at 5/23/2007 3:57:46 AM
I have a cpp application with this structure:
//////////////C++///////////////
typedef struct StatusStructure
{
char FixedLenString[255];
long LongVariable;
double DoubleVariable;
BOOL BoolVariable;
} StatusStructure;
//////////////end C++///////////////
I have to recover this stru... more >>
C# windows form never minimize
Posted by Tiago Marques at 5/23/2007 3:41:01 AM
Hi,
I'm creating a kind of a gadget using C# and windows forms.
For this to work I need it to that it won't ever get minimized, even if the
user presses Windows+D or Windows+M.
Does anyone knows how can I do that? Or am I thinking about this in the
wrong way?
Thank you very much for yo... more >>
Custom Software Development
Posted by VB at 5/23/2007 3:24:53 AM
iTechArt Group - Custom Software Development and Offshore outsourcing
Company
http://www.itechart.com/
Offshore custom software development company iTechArt - Web site and
Content Management Solutions development, CMS consulting: Ektron,
Drupal and DotNetNuke
iTechArt Group provides high... more >>
Refering Assemblies
Posted by Puneet Bhatnagar at 5/23/2007 2:10:19 AM
Hi
Can we refer an Assembly from an Assembly.
Can we have cross Reference also in .NET.
Thanks In Advance
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com... more >>
Task Scheduler 1.0: Interfaces are provided for C++ development. What about C#?
Posted by Ryan Liu at 5/23/2007 1:14:04 AM
When I look at MSDN, I found there is a thing called Task Scheduler 1.0/2.0.
But it says:
Task Scheduler 1.0: Interfaces are provided for C++ development.
Are there class lib for C# developers?
Thanks,
... more >>
Timer and Thread.Sleep()
Posted by Ryan Liu at 5/23/2007 12:49:30 AM
Hi,
For the taskes which will be executed once a while, I used to write an
endless loop, do the job then call Thread.Sleep().
I just notice threre is server-based Timer. What are the advantages to use
that?
Thanks a lot!
Ryan
BTW, my previous two posts never show up, is this mailing... more >>
excel doesn't close after SaveAs; com object release trouble
Posted by Hendri Adriaens at 5/23/2007 12:00:00 AM
Hi,
I'm trying to automate the creation of an excel file via COM. I copied my
code below. I read many articles about how to release the COM objects that I
create. The code below runs just fine and excel is closed. But there are
some commented lines:
//xlSeries.XValues = xlWs.get_Range("B... more >>
Stopping the Cancel button
Posted by MaxMax at 5/23/2007 12:00:00 AM
I have a dialog box with a Cancel button that I want to be activable with
the ESC key. In the form the Cancel button is connected to the CancelButton
property. Now my problem is that the OnClick event of the button must be
able to "stop" the closing of the form: I want to change the text of th... more >>
SqlDataSource and DataSet question
Posted by Jason Huang at 5/23/2007 12:00:00 AM
Hi,
I would like to know what the DataSet name is and where the DataSet is for
a SqlDataSource like this:
<asp:SqlDataSource ID="SqlDataSourceA" runat="server" ConnectionString="<%$
ConnectionStrings:ServiceConnectionStringA %>"
SelectCommand="SELECT TestNo, AcceptDate, status FROM TestF... more >>
|