all groups > c# > january 2005 > threads for thursday january 20
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
[R U a genius?] .Net regular expressions (csharp)
Posted by Daniel Dupont at 1/20/2005 11:31:34 PM
Hi there,
I want to test a String. This string must be made of
- 8 numbers
- then a single underscore
- and then 6 numbers
Can anybody tell me what can be the right .Net pattern ?
String sample :
"20041224_235959" (latest christmas)
"20011109_140000" (9/11 crime - CET)
"19891009_180... more >>
System.Drawing.Bitmap alpha
Posted by instruo at 1/20/2005 11:25:02 PM
I'm using the System.Drawing.Bitmap class for loading a 32-bit bmp file which
includes an alpha channel.
The problem is, when it gets loaded (just using the Bitmap(string filename)
constructor), it doesn't bother bringing the alpha along with it. All of the
pixels just show "255" as their ... more >>
Windows service with timer doesn't work in Windows 2003 server
Posted by Dhilip Kumar at 1/20/2005 10:58:42 PM
Hi all,
I have developed a windows service using the windows service project
template in VS.NET. I have used three controls in the service, a timer,
performance counter and a message queue control. The service will "sleep"
for 'n' seconds using the timer control and whenever the timer_ela... more >>
How to Sync Dataset to Database on SQL Server? Help!
Posted by Karl at 1/20/2005 10:05:01 PM
Hi C# experts,
I am to C# and .NET.
I am writing a database application using C# and Dataset. In Sql server, I
have a Acount table which contains over 100,000 records. This table will be
accessed and updated by many users at same time. So the data in this table
keeps changing and growning.... more >>
How to test if excel is installed?
Posted by Mansi at 1/20/2005 9:11:05 PM
I'm trying to automate excel from visual c#. One thing I need to be able to
test is if excel is even installed on the target machine and what version of
excel is installed on the target machine. Is there a way to do this via c#
code?
Thanks.
Mansi... more >>
Generating XML file for NDoc
Posted by Naveen Mukkelli at 1/20/2005 5:51:03 PM
Hi,
I'm learning to use NDoc..
I'm facing a strange problem, well .. at least for me.
I could not find the XML file. I'm able to generate XML comment web page
though.
How can we generate XML file from C# code comments so that we can use
the XML file in NDoc..
I'm usin... more >>
What does '64 bit' mean? Lame question, but hear me out :)
Posted by Larry David at 1/20/2005 5:21:31 PM
Ok, first of all, let's get the obvious stuff out of the way. I'm an =
idiot. So please indulge me for a moment. Consider it an act of =
"community service"....
What does "64bit" mean to your friendly neighborhood C# programmer? =
The standard answer I get from computer sales people is... more >>
ArrayList and its Insert method
Posted by Zeng at 1/20/2005 4:55:11 PM
Hello Everyone,
Is there anything wrong with this block of code?
ArrayList arr = new ArrayList( 33 );
for( int i = 0; i < 33; ++i )
{
arr.Insert( i, new MyObject() );
}
It's so strange that when my web application have another thread allocating
and deallocating bit junks of memor... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
New Line in a textbox
Posted by MuZZy at 1/20/2005 4:40:23 PM
HI,
Stupid question - how do you insert a new line symbol in a multiline TextBox?
I try a standard textBox.Text = "Line1 \n Line2";
but it doesn't work, i see "Line1 Line2" and a "square" symbol between them
Thank you,
Andrey... more >>
Signature or prototype or either?
Posted by mark4asp at 1/20/2005 4:19:56 PM
In Amit Kalani's book (0789728222, 70-315 exam prep. book) he
says that:
"a delegate is a special class whose object is
capable of storing references to methods with
a particular prototype"
elsewhere (in C# books I'm studying) the term used is signature.
Is it signature or prototype or ... more >>
Com dll usage problem in C#?
Posted by Ă–zden Irmak at 1/20/2005 4:18:37 PM
Hi,
I've a com dll developed in VB6. I want to use this dll in a C# application.
I set the references to that control and created an instance of the class
set to a variable. But when I call a property in that class I get this error
:
Property, indexer, or event 'SourceDatabaseConnectionS... more >>
given a Hashtable and an Index, how do I retrieve the key?
Posted by Andrew Robinson at 1/20/2005 3:52:34 PM
given a Hashtable and an Index, how do I retrieve the key?
Hashtable h = new Hashtable();
h.Add("red", 3);
h.Add("blue", 99);
h.Add("green", 33);
how do I get the key at index 2?
h.Keys[2] should equal "green".
thanks,
-Andrew
... more >>
Handles syntax in C# - must be easy
Posted by Ed West at 1/20/2005 3:41:04 PM
I can't find this answer anywhere! I am making a class that inherits
from StatusBar control and I want to convert this function to C#...
Private Sub Reposition(ByVal sender As Object, _
ByVal sbdevent As System.Windows.Forms.StatusBarDrawItemEventArgs) _
Handles MyBase.DrawItem... more >>
How to remove richtext format?
Posted by Du at 1/20/2005 3:34:06 PM
I like richtext textbox and its shortcut, but I don't need the richtext
format. How do I tell the richtext text box to strips all the format and
convert everything to plain text?
Thanks
... more >>
XML Commenting problem.
Posted by Naveen Mukkelli at 1/20/2005 3:33:01 PM
Hi All,
I'm trying to create XML commenting for my code using XML commenting
feature
for the first time. I'm using VS.NET 2003 and C#.
I'v tried the following way.
Step 1: set the file name for xml file in
"Project Properties | Configuration Properties | Build | ... more >>
Async socks in a separate thread
Posted by MuZZy at 1/20/2005 3:17:02 PM
Hi,
Could someone pls help me here:
If i use async sockets in the separate thread like this:
void ThreadFunction()
{
.....
1. MySocket.BeginAccept(AsyncCallBack(OnConnectRequest), MySocket);
2. ??????????
}
What do i do after line 1?
Do i put an endless loop in order to keep the... more >>
Determining image sizes
Posted by timm.wong NO[at]SPAM gmail.com at 1/20/2005 3:16:23 PM
Hi,
I have a program where I load images to a screen. How would I go about
determining the size of an image prior to loading it on the screen?
Thanks,
Tim
... more >>
Making my own command prompt
Posted by C. Adam Barney at 1/20/2005 3:01:38 PM
I would like to create my own command prompt application using .NET.
I'm looking to start off with a basic framework, essentially passing
commands through to cmd and displaying the results.
However, I'm stuck on creating even the framework. The approach I've
been looking at involves using a p... more >>
NotifyIcon ContextMenu Bug
Posted by Derrick at 1/20/2005 2:28:49 PM
I've been working on an application which has a NotifyIcon (system tray
icon), and a corresponding ContextMenu. I want to be able to update this
menu dynamically. However, when I make changes to the menu, it seems to
disappear. This only breaks when the context menu is tied to a NotifyIcon -
... more >>
convert IntPtr to float **
Posted by lisa.shmulevich.b NO[at]SPAM bayer.com at 1/20/2005 1:57:09 PM
Hi all
I have to use unmanaged COM from .Net environment. This component does
some calculations on a two dimensional array of data and returns
another two dimentional array of processed data.
I've added a reference to this COM. Then I've instantiated an object
of its type. Now I want to call a ... more >>
PLS HELP - Unable to close a "stuck" thread
Posted by MuZZy at 1/20/2005 1:37:42 PM
Hi,
Sorry for a repeated post but i didn't receive an answer and will try to re-phrase my question:
How do i close an additional thread from the main thread,
if this additional thread is stuck waiting for a blocking operation, eg.
if in this additional thread i wait for a Tcp connection:
... more >>
datagridColumn.FormatInfo: how can i change the display value of a double to be divided by 100?
Posted by support NO[at]SPAM zerama.net at 1/20/2005 1:28:38 PM
Hi all,
I could use a little help.
I am trying to customize a displayed value in a dataGrid. What i would
like to do is create a IFormatProvider
that will set my column to be displayed in terms of 100, where 100 = 1.
I have not been able to figure this one out.
I have been messing around w... more >>
Installing several instances of an app as services
Posted by Roland Riess at 1/20/2005 1:21:54 PM
Hi all,
at the moment i am developing an app which is sort of an interface to
copy data from one database to another and it shall run as a service.
As there are several databases the app must be installed and run in
multiple instances with the configuration data (database, login, etc.)
sto... more >>
TopMost problem
Posted by Hovhannes Asatryan at 1/20/2005 12:51:04 PM
Hello guys.
I have a problem with a topmost form.
I am writting in C#.
I have Mdi Form wich has 2 child forms.
I want to set one of them as a topmost window, but when I sets MdiParent the
TopMost property does not working.
How can I set the one form as a topmost?
Can anyone send me code ex... more >>
Listbox item not a string object, updating items
Posted by Claire at 1/20/2005 12:34:41 PM
As a Listbox.item, rather than using a string I'm using a ListItems object,
overriding the ToString method
When I add items to listbox.items, my strings are shown correctly.
On the otherhand, when I update the "value" field the listbox doesn't update
to reflect the new value.
What do I need t... more >>
Clone
Posted by Semut at 1/20/2005 12:16:45 PM
Hello,
When do I need to use the Clone function? I am aware that instances that
inherited Forms.Control will somehow be of reference types instead of value
types. I have tested that ArrayList behave the same as well. Anyway that I
could know when I need Clone when I do not want to m... more >>
Check if a file is allready open by other application
Posted by Marcel Hug at 1/20/2005 12:04:46 PM
Hello NG !
I would like to test, if a file in my subtree is allready in use by an other
application.
Do anybody know how to get this information ? It is possible to get this
information ?
Thanks and regards.
Marcel Hug
... more >>
C#.NET and google.api
Posted by lilyminako NO[at]SPAM yahoo-dot-com.no-spam.invalid at 1/20/2005 11:53:50 AM
I try to use C#.net to build a multimedia search engine which will
intergrate with google api to get the results. Visual studio.NET is
my development enviroment and ASP.NET web application is my visual C#
project. Where can I find the sample C# codes for this kind of web
application development... more >>
System.IO.File.Exists behaves differently when run from a mapped drive
Posted by Zeno Lee at 1/20/2005 11:42:41 AM
I'm using File.Exists to test a file on my C: drive.
My program was strongly named and had caspol -af run on it to allow it to
run from the network.
There are 3 ways I am doing this:
1) Run from my C: drive, File.Exists works properly and says
C:\Temp\test.txt exists
2) Run from my H:\ (... more >>
.net installers
Posted by C.E.O. Gargantua at 1/20/2005 11:17:13 AM
I wrote a little c# app to send SQL queries to a iSeries 830 and return
the results in a data grid.
Now I want to create a deployment program.
It's using the iSeries DB2 Provider for .NET which is part of a CD
install. The key DLL is:
ibm.data.db2.iseries.dll
I created a Setup pr... more >>
Determining which encoding the browser used for a url
Posted by Jon Maz at 1/20/2005 11:02:30 AM
Hi,
I am working on a dotnet url rewriting mechanism that has to be able to deal
with urls containing non-standard characters, eg
http://www.mysite.com/Télécharger.
The problem is that some browsers will encode this url using utf8 & some
using ISO 8859 (I *think* those are the only two poss... more >>
How to use kerbros in a webpart(Asp.Net Custom Control)
Posted by ALI-R at 1/20/2005 10:53:53 AM
I'm writing a webpart which is supposed to connect to a Webserice in our
interanet.I am using "RSService.Credentials =
System.Net.CredentialCache.DefaultCredentials;"to Authenticate to the
webservice.but it dosn't work.why?
I think SharePoint which hosts my webpart authenticate the user requ... more >>
Sending email
Posted by John S at 1/20/2005 10:32:41 AM
I have applied this code
myMessage.To=MessageTo;
myMessage.From=MessageFrom;
myMessage.Subject=Subject;
myMessage.Body=Body;
myMessage.Priority=MailPriority.High;
SmtpMail.SmtpServer=SMTPServer;
but I keep getting back the error message
"Could not access "CDO.Message" object.
What am I mi... more >>
Passing filename as a command line parameter
Posted by jlea at 1/20/2005 10:26:00 AM
I'm trying to pass a filename, obtained with using the fileName property
from the OpenFileDialog, as a application parameter in
Process.StartInfo.Arguments and run a MFC/C++ application using the Start
method.
When I hardcode the application parameter such as "/name=c:\\myFile.txt" all
is wel... more >>
array's type
Posted by frisco at 1/20/2005 10:17:43 AM
by reflection I can infer that a property is Array type.
But how I can get the type the array is composed from?
for instance:
string[] table;
I want to get String and not Array
thank you
... more >>
the wise use of singleton
Posted by phl at 1/20/2005 10:14:23 AM
hello,
My project in a web project. I choose to use singleton in one of my
projects. Towards the end I realise that I seemed to have refered to
the fields singleton in my other classes in my business logic a little
precariously. I access my the fields in the singlton in my BLL classes
directl... more >>
HashTable
Posted by Sreekanth at 1/20/2005 10:02:11 AM
Hello,
Is there any better collection than HashTable in terms of performance, when
the type of the key is integer?
Regards,
Sreekanth.
... more >>
Convert double to string
Posted by Laurence at 1/20/2005 9:47:25 AM
I want to convert a double value to string.
1.2345678911 -> "1.234567891"
123 -> "123"
I used the following code to convert it:
string str = doubleValue.ToString("f9");
but the second value is converted to "123.000000000".
So I changed the code to:
string str = doubleValue.ToStr... more >>
.Net code to Detect When an External Drive is Mounted?
Posted by Sped at 1/20/2005 9:46:14 AM
Hi,
I'm looking for some code to monitor for when an external drive is
connected to a computer (USB ThumbDrive, External Hard Drive, etc.) and
is assigned a drive letter.
I'd want my code to trigger off of the mounting process so I can search
for a specific file on that hard drive (which is... more >>
Parsing CSV data into XML
Posted by Abi at 1/20/2005 9:13:05 AM
Hello there,
I have a function to parse csv data and then create an xml file out of it.
Here's my function
private string delimtedDataSet( string strDelimiter,string strpath,string
outpath)
{
DataSet oDs = new DataSet();
DataTable oTable = new DataTable();
DataRow oRo... more >>
Why is inccorect Static Method called?
Posted by Greif at 1/20/2005 9:03:03 AM
I am trying to call a static method within a sealed class. However, the wrong
method keeps getting called instead.
In a seperate class I am calling the following code:
LogHelper.Log("Sample Exception", ex, LogLevel.ERROR);
Here is the weird thing, the public static void Log(string message, ... more >>
System.Drawing Resource
Posted by ZUP_DUDE at 1/20/2005 8:28:46 AM
Hi All,
I'm looking for a good paperback resource on the System.Drawing
objects. I'm looking to create graphs and convert graphics from one
type to another. Any Suggestions would be helpful.
Thanks in advance
... more >>
Validating XML Using XML Schema
Posted by Ram at 1/20/2005 8:25:43 AM
Hey,
I have a XML Schema, and a XML file.
How can I validate that the XML file is implements the XML Schema meaning
that it is build correctly
Thanks ahead
--Ram
... more >>
"Restructure a Windows application" from scratch in 2 months
Posted by Rajat Tandon at 1/20/2005 7:59:11 AM
Hello Everybody,
Please guide me so that I can fulfill this challenging assisnment ...
I have been asked to "Restructure a Windows application" from scratch in 2
months. The existing application which is working but it is very heavy as no
proper application architecture and layering has been... more >>
XmlSerializing an array of CollectionBase
Posted by morten.dyndgaard NO[at]SPAM get2net.dk at 1/20/2005 7:45:09 AM
Hi,
I want to do the following:
I have to XmlSerialize a HashTable, but since it inherits from
IDictionary it cannot be XmlSerialized, and I prefer not to make my
own implementation of IXmlSerializer.
So, I make two arrays, one containing the keys and one containing the
values, and I wo... more >>
WScript and VBScript
Posted by Daniele at 1/20/2005 6:31:06 AM
How is it possible to call the WScript object? I haven't found it in any
namespace... is it only for VBScript? If yes, is it possible to launch a .vbs
programmatically from c#?
Thanks,
Daniele... more >>
Catching duplicate inserts into SQL Server Database Table
Posted by Stuart Ferguson at 1/20/2005 6:28:31 AM
I am currently in the process of developing a transaction loading
service which parses an xml file and loads these transactions to a
Database.
The problem i am having is if i try to process the same file twice
(accidentally copied into the listening folder twice) then the
transactions are ins... more >>
HELP: DataView does NOT filter :-(
Posted by werk NO[at]SPAM velp.info at 1/20/2005 6:26:10 AM
For limiting access to the database to strictly necessary I try to
filter the query by using DataView.
Thw DataSet ds contains three columns (fields) : (LAND_ID, Landcode,
Landnaam) and four rows.
I try to filter out only one country (key is LAND_ID) with the
following code:
DataTable dt =... more >>
c# - excel - interop - numberformat
Posted by stf at 1/20/2005 6:05:05 AM
Hello,
I use c# to start excel and to get numberformat of active cell. VBA outputs
results as expected, but via c# i get result 'Standard' instead of 'General'
for a call to numberformat. Why?
It look's like 'numberformatlocal' is returned instead of 'numberformat'.
Output of C#:
Numberf... more >>
SQL UPDATE record with Image field
Posted by Tinius at 1/20/2005 5:57:03 AM
I am trying to update a field of type IMAGE.
I am able to do this by deleting the record and then INSERTing a new record
as shown below in the commented section.
But I really want to do this with an UPDATE command as shown below in the
un-commented code. I assume this is possible.
The ima... more >>
Enum.Parse doesn't trigger an exception (C# 2.0)
Posted by cadilhac NO[at]SPAM gmail.com at 1/20/2005 5:08:00 AM
Hi,
I have the following code:
public enum MyColors { Red, Green, Blue }
MyColors c = (MyColors)Enum.Parse(typeof(MyColors), "abcd");
Why do I get c = "abcd" after this code instead of getting a
ArgumentException ?
MSDN says that this expetion is triggered when value is a name, but not
... more >>
Click event before on init
Posted by Josema at 1/20/2005 5:07:03 AM
Hi,
I would need that when i click the button the code of the Onclick method
executes first, and then the onInit Method...
Its possible make this?
--
Thanks
Regards.
Josema... more >>
How to cycle through all TextBox in a Form ?
Posted by fmarchioni NO[at]SPAM libero.it at 1/20/2005 3:39:57 AM
Hi all,
I need to highlight textbox in a Form when they are selected.
In order to do it I have added for each one a .GotFocus and .LostFocus
Event Handler....
textRS.GotFocus += new EventHandler(gotFocus_Event);
textName.GotFocus += new EventHandler(gotFocus_Event);
textSurname.GotFocus +=... more >>
How to: Use RangeValidator Control
Posted by charliewest at 1/20/2005 2:17:02 AM
I've configured a RangeValidator control on a WebForm, using ASP.NET, and
have set the type to string, the max value to 100, and min value to 1,
however, the control to validate always throws an error, regardless of the
length of the string. For example...
<asp:textbox id="txtQuestion" run... more >>
Compiler error with foreach?
Posted by Pathogenix NO[at]SPAM gmail.com at 1/20/2005 1:53:51 AM
Interesting little problem; go easy on me because I'm just a humble
scripter turned c# developer.
I've a class UserList which I auto-generated with a python script, it
extends CollectionBase and has the usual methods: this[int index],
Add, Insert, Remove and Contains. There are no differences ... more >>
Unable to Abort a listening thread
Posted by MuZZy at 1/20/2005 1:03:31 AM
HI,
As i posted below i have an app with a separate thread listening for a tcp client connection.
In the simplest way it looks like:
void ListenerThreadFunction()
{
TcpListener l = new TcpListener(IpAddress.Parse("127.0.0.1"), 8080);
l.Start();
Socket client = l.AcceptSocket();
clien... more >>
scrollbar
Posted by jima80 NO[at]SPAM gmail.com at 1/20/2005 12:38:53 AM
I have a chart with data and I want to add a scroll bar there but to
do a paging - each time I move the scroll bar to add a data (to divife
all the data untill all of it will be presented)
What is the best way to do it?
Thanks a lot!... more >>
StrongNameIdentityPermission not checked
Posted by James Hadwen at 1/20/2005 12:36:17 AM
I'm not sure whether I'm doing something wrong, or
StrongNameIdentityPermission just doesn't work in 2.0 beta 2 yet.
public class Class1
{
[StrongNameIdentityPermission(SecurityAction.Demand, PublicKey =
Keys.PUBLIC_KEY)]
public Class1()
{
System.Diagnostics.Debug.Ass... more >>
Get remote TcpClient address
Posted by MuZZy at 1/20/2005 12:08:39 AM
HI,
How do i get a remote TcpClient address here?
// =======================================
TcpListener l = new TcpListener(IPAddress.Parse("127.0.0.1"), 8080);
TcpListener.Start();
While (true)
{
TcpClient cl = l.AcceptTcpClient();
<Here i need to get the client's ip address>
}... more >>
|