all groups > c# > october 2004
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
How do I do this in C#?
Posted by hplloyd at 10/31/2004 11:22:04 PM
Hi,
Im trying to move away from VB to C#.
In VB I can write a line of code that takes a characeter, converts it to an
ASCII number (base10) and then converts that base10 number to hexadecimal by
using the following command
hex(asc("C"))
how do I do this in c#?
You might have gues... more >>
XmlSerializer and collections
Posted by Sebastian Sylvan at 10/31/2004 10:15:07 PM
Hello.
I'm trying to serialize an object using the XML-serializer. A simple
object is okay, But when I try to serialize an object which has a public
List<SomeType> the program hangs upon calling the XmlSerializer constructor.
I have verified that everything in the object is okay (not null). ... more >>
async web service just don't get it
Posted by Tom at 10/31/2004 9:30:57 PM
public class Client
{
public Server svr;
public void callbackMethod(IAsyncResult asyncResult)
{
svr.EndAsyncMethod(result)
}
[STAThread]
static void Main(string[] args)
{
svr = new Server();
object stateobj = new object();
Cal... more >>
form with vertical sizing only
Posted by slamb NO[at]SPAM cognex.com at 10/31/2004 6:50:13 PM
I'm trying to make a form that can be sized vertically but not
horizontally. Any pointers?
First attempt was to
set the form's FormBorderStyle = Sizeable
set the form's MaximumSize.Width to the fixed width
Unfortunately, the users still sees these cursors, SizeNESW, SizeNWSE,
and SizeW... more >>
Tranferring parameters to structs in a class?
Posted by ORC at 10/31/2004 6:35:27 PM
How to transfer a parameter to a structure in a class?
In a class (MySubClass) I have defined a private structure (I don't want it
to be public) and a property {get; set} like this
private TestStruct
{
public int member_1;
public int member_2;
}
TestStruct TS = new TestStruct()... more >>
Global Variable Problem
Posted by David DeLella at 10/31/2004 5:51:24 PM
I am writing a piece of software which loads multiple parts into different
panels. Each panel can access other panels by accessor methods. My team
wants to create a global variable of type Queue from the System.Collection
class. We want to be able to access this variable in other panels via... more >>
continuously running thread?
Posted by Raed Sawalha at 10/31/2004 5:36:23 PM
Hello:
I have 2 windows application 1st one is periodically writing specific data
to XML file , the 2nd application has a dialog with DataGrid , the datagrid
filled with information in the XML generated by 1st application and should
be updated as soon as the XML file is update, so I decide to... more >>
Getting the xpath for a specific node in a xmldocument
Posted by Paw Pedersen at 10/31/2004 4:59:25 PM
When you are "working" on a specific node from a XmlDocument instance, is it
possible to get the full xpath to this node?
Regards Paw
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Queue Collection changed
Posted by Tamir Khason at 10/31/2004 12:48:23 PM
I have a queue, wich recieves a lot of messages (between 10 and 100 a
second)
There is thread that takes care on this queue, but as far as I see it can
not follow the messages so "Collection was modified; enumeration operation
may not execute." exception thows. How to take care on it
txn
... more >>
application name
Posted by Chang at 10/31/2004 12:12:37 PM
how to get the name of a running application using C#
e.g. if i have 20 dll files and my application name is MyGreatApplication
then how to get the name "MyGreatApplication" at runtime?
thx in adv.
c
... more >>
rotate control
Posted by Chris at 10/31/2004 11:12:54 AM
Hi,
Is it possible to rotate a control on a form ? (e.g. Button, customcontrol)
thnx
Christian
... more >>
Text Files: How To
Posted by Chang at 10/31/2004 10:39:22 AM
hello ng,
how can I read/write/clear a ascii text file in one go (same also for
binary file). also while i am doing that no other application/process should
be able to read/write/clear to that file. also what process/method should i
call to see if there is any read/write/clear is happening... more >>
Context Switching Question
Posted by JRB at 10/31/2004 9:50:06 AM
Hi, I'm creating a small C#program that communicates through the serial port.
I have a separate thread that continuously takes in data from an external
device in a while loop. The problem is that when I try and run another
program, open a menu, or anything, I miss getting bytes. If I set the t... more >>
Visual style
Posted by David at 10/31/2004 8:57:01 AM
Hello there can i read tutorial/instruction/howto to make my windows look
better, in style of WMP 10, ICQ lite...
or even any examples...
thnx...
David.
... more >>
how i search a string with google from a console appliction?
Posted by liranby NO[at]SPAM hotmail.com at 10/31/2004 7:41:33 AM
Hi
I am making a console application, which I need to search a string
with google . How can I do it?
Liran... more >>
Registry Permissions
Posted by frank.fabian NO[at]SPAM hp.com at 10/31/2004 7:28:40 AM
Hello!
Does anybody know how to get and set the permissions of a registry key using C#?
Thank you
Frank... more >>
C# Thread safety
Posted by Sherif ElMetainy at 10/31/2004 4:01:12 AM
Hello
Are these 2 properties (please see below) thead-safe? These properties are
generated in the Resources.cs and Settings.cs files in Visual Studio 2005
(whidbey beta 1).
According to CLI memory model specification
http://dotnet.di.unipi.it/EcmaSpec/PartitionI/cont11.html, Section 11.6.8
... more >>
sqlserver stored procedure
Posted by aditya pathak via .NET 247 at 10/31/2004 3:57:59 AM
I have created this stored procedure but it give a runtime error ==Invalid object name '@v3'===.
please help me what to do?
-------------------------------------------------
CREATE proc updateLangRow
@id int, @des text, @fl1 text, @fl2 text
as
set nocount on
declare @v1 varchar(200)
... more >>
Indexof problem, or what?
Posted by How Gee via .NET 247 at 10/31/2004 3:57:49 AM
Hi All!
Please help me. Here is a very simple C# code:
string text="asdasdC4C81A9CCsdfsdf";
Console.WriteLine(text.IndexOf("C4C81A9CC").ToString());
The result is -1, but why?
A little bit change:
string text="asdasdC4C81A9CBsdfsdf";
Console.WriteLine(text.Inde... more >>
Why doesn't ImportRow() work?
Posted by Michael Van Altena via .NET 247 at 10/31/2004 3:49:53 AM
Why doesn't the following add a row to the table dtTemp1?
System.Data.DataTable dtTemp1 = new System.Data.DataTable("Test1");
dtTemp1.Columns.Add("ColumnA", System.Type.GetType("System.String"));
dtTemp1.Columns.Add("ColumnB", System.Type.GetType("System.Decimal"));
System.Data.DataRow o... more >>
Iterating through an enumeration?
Posted by Jamie Winder via .NET 247 at 10/31/2004 3:48:06 AM
Is it possible to iterate through all of the possible values of an enumeration? (with foreach, maybe?)
What I need to do is fill a ComboBox with all possible values for an enumeration.
e.g
foreach ([value] in [enumeration])
{
comboBox1.Items.Add (value.ToString ("G");
}
Is this pos... more >>
circular dependency
Posted by Rimma Meital via .NET 247 at 10/31/2004 3:47:40 AM
(Type your message here)
--------------------------------
From: Rimma Meital
I have 2 DLLs (Class Libraries). Both defines single-ton objects - logger object (writes to logger) and application_management object (stores paths and other things, reads ini file of the application).
Both needs to r... more >>
mysterious message
Posted by Michael Maercker at 10/31/2004 2:33:19 AM
i'm getting the (scary) message that parts of my code were changed "outside
of the code-editor"?
what does that mean?
mike
... more >>
calling WinApi functions from c#
Posted by Michael Maercker at 10/31/2004 2:08:50 AM
hi! i knew how to define api-calls in vb6... how do i do it in c#? say, for
example, "SetWindowPos"...?
thx,
mike
... more >>
Inheriting a Base class in a web form
Posted by Peter Cresswell at 10/31/2004 12:05:02 AM
Hi guys/gals,
I'm using VS.net 2003 and having trouble with the following:
I am trying to inherit a base class into a web form, but VS will then not
allow me to add any ASP.NET controls using the designer. The base class does
derive from System.Web.UI.Page.
Here's a code snippet:
pub... more >>
Getting stackpointer safely
Posted by Mike.Spertus NO[at]SPAM veritas.com at 10/30/2004 10:22:31 PM
Is there a way to get an approximate stackpointer into an int in C#?
The following works, but is unsafe and adds a new variable to the
stackframe:
int i = (int)(&i);
It seems like it should be possible to do this safely because I never
dereference a pointer. Perhaps there is a safe way ... more >>
Please help on this problem, Pretty Please
Posted by mattgcon at 10/30/2004 8:22:02 PM
When I use a stored procedure to insert data into a table and when the
Datagrid refreshes two new columns are added. The dataSet is set up with one
table with NO columns defined. Please help me on this. I have screen shots of
the before and after.
Here is the code:
sqlCommand.CommandTy... more >>
Reusing code without creating a class library.
Posted by Craig Kenisston at 10/30/2004 8:02:55 PM
If I try to add existing *.cs files to my project the are copied my working
directory !
I want to keep some general purpose classes outside the projects in a single
place, so, if I improve a class it is reflected in all the projects.
Is that possible ?
... more >>
Issue with zero-length string as input to Decimal typed parameter.
Posted by Guadala Harry at 10/30/2004 6:18:48 PM
What do to about conversion to decimal type when blank is allowed?
The situation is this. In the UI there is a textbox into which users can
enter a value which is supposed to be a dollar amount. The value is optional
(i.e., leaving the textbox blank is perfectly acceptable). The problem is
tha... more >>
Serial port reading
Posted by ORC at 10/30/2004 5:55:25 PM
I have made a serial port class inspired bu the MTTTY example and the serial
port class from OpenNETCF . below is the code from the readfile method in
which there is a problem. The code calls the WaitForSingleObject function
but always locks there until the timeout happens (GetOverlappedResult is... more >>
MS Office installed
Posted by Patrick Blackman at 10/30/2004 4:53:11 PM
How do you determine the installed MS Office products?
Thanks Patrick
... more >>
How do you determine the registered company on a computer
Posted by Patrick Blackman at 10/30/2004 4:52:11 PM
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C4BEA0.CCB6BFB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
How do you determine the registered company on a computer?
Thanks Patrick.
------=_NextPart_000_0006_01C... more >>
Pronouncing Enum
Posted by John Wood at 10/30/2004 4:51:13 PM
OK here's a random one for you:
How do you pronounce enum when you say it?
Some say "e-noom", others say "en-um".
... more >>
Compilation Error :placement arguments not allowed?
Posted by Raed Sawalha at 10/30/2004 4:42:52 PM
I don't I'm asking in right place , but I looked for a Managed C++ group to
ask and didnt find i have the following scenario
I've created MFC Application using Visual Studio 2003, then change the
project settings
to use Managed Extensions as follows:
1. Configuration Properties->General->... more >>
Does "new IntPtr();" return a zero pointer ?
Posted by ORC at 10/30/2004 4:38:17 PM
When initializing a IntPtr can I then be sure that this initializes to a
zero pointer: ?
"IntPtr MyPointer = new IntPtr();"
Thanks
Ole
... more >>
Security Issue
Posted by web1110 at 10/30/2004 3:49:23 PM
Hi,
I set up my wifes machine to run .NET, some of my stuff runs but not all.
First example:
I have a windows program that displays environment info. It runs fine on my
machine. Whan I run it on my wifes' machine over the network it fails on
the statement:
values.Add ("WorkingSet... more >>
Importing syntax coloring configuration
Posted by Nicolas at 10/30/2004 3:35:52 PM
Hi,
I'm trying to import the syntax coloring settings I set on another
installation of Visual Studio .NET, but I can't find any configuration
file or option to achieve this. How can this be done ?
Thank you for your help.... more >>
Is there a way of embedding Text with in .EXE
Posted by MikeY at 10/30/2004 1:37:44 PM
I am trying to figure out if there is a way of storing information within
the .exe. TextFile or other storage means, so that when I transport my
application I don't need to take the text file or other storage means with
it. Example (When I make a help button that pops up a window I want the info
... more >>
Execution Problem
Posted by web1110 at 10/30/2004 1:09:08 PM
Hi,
I am playing with C# again. I have a network setup at home and the C#
applications I develop on my machine work fine. However, when I try to
execute one of them on my wifes' machine over the network, I get the
following error:
The application failed to initialize properly (0xc0000... more >>
show files by extension
Posted by bernardpace NO[at]SPAM yahoo.com at 10/30/2004 11:30:50 AM
Hi,
I am trying to show files of type mp3 or wma or of type both. To
show either of mp3 or wma I am doing as follows(choosing file type by
a radio button),
DirectoryInfo currentDir = new DirectoryInfo(path + "\\");
FileInfo[] allFiles;
if (MP3s.Checked == true)
allFiles = currentDir.Get... more >>
Active Directory
Posted by Hemang Shah at 10/30/2004 7:23:02 AM
Hello Group
What is a security descriptor in Active Directory?
Is this what stores all the permission for that object ? If so, how would
you modify it using c# ?
Is there any example around ?
Thank You
__________________________________________________________________________
Heman... more >>
Problem with delphi dll
Posted by eloy NO[at]SPAM tlen.pl at 10/30/2004 6:44:15 AM
Hi,
I have very big problem with importing delphi dll into C# project...
I got a Velleman K8000 card with k8d.dll that makes all communication
for me. Now I'm trying to import it into C#, but I cannot get it
worked...
(I'm not quite sure if it is delphi dll!)
Everything about it you can se... more >>
Laser Printer Problem for printing an image in C#
Posted by Mina Gohari at 10/30/2004 5:50:32 AM
Hi all
I have a problem with printing a report card to laser printer.
Everything works properly on ink-jet printer, but when I use laser
printer , it's not in predifined format. everything is mix-up.
Bitmap bmpi = new Bitmap(1169, 827);
Graphics bmp = Graphics.FromImage(bmpi);
bmp.... more >>
C# 2005 Express and FWK version
Posted by Simon McDonald at 10/30/2004 12:24:51 AM
Hi,
Does C# 2005 Express run on .Net Fwk 1.1, or only on 2.0 (Beta)
Thanks
Simon
... more >>
Duplicate dates
Posted by Trond at 10/29/2004 11:45:17 PM
I have been trying to fig out how to build up an array with dates. When its
generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not an
array.
... more >>
How is the Com port string format in VS 2005 ?
Posted by ORC at 10/29/2004 11:11:26 PM
The string format of a com port when opening a port in win32 API is "COM1:"
but how is it in VS 2005 in the System.IO.Ports.SerialPort.PortName property
(with or without the ':' character) ?
Thanks
Ole
... more >>
regex - better way?
Posted by rjb at 10/29/2004 10:53:41 PM
Hi!
Could somebody have a look and help me to optimize the code below.
It may look like very bad way of coding, but this stuff is very, very new
for me.
I've included just few lines.
Regex regxUserName = new Regex(@"(?<=User-Name = )\""([^\""]+)\""",
RegexOptions.None);
Regex regxSessio... more >>
CAn't find System.Runtime.Remoting.Channels.Http
Posted by web1110 at 10/29/2004 9:38:40 PM
Hi y'all,
I'm playing with C# again, trying to implement a remoted calculator
exercise.
If I include:
using System.Runtime.Remoting.Channels.Http;
I get the error:
s:\tmp\CalcServer\CalcServer\Class1.cs(4): The type or namespace name
'Http' does not exist in the class or nam... more >>
is bool a 32 bit integer?
Posted by ORC at 10/29/2004 9:22:15 PM
Is the bool type actually an Int32 with 0 as false and non zero as true? The
reason for my question is that I've seen a lot of API calls that return a
Int32 implemented in C# as an bool like:
[DllImport("kernel32.dll", EntryPoint="PurgeComm", SetLastError=true)]
private static extern bool PurgeC... more >>
using Dataadapter to update Database
Posted by ALI-R at 10/29/2004 6:39:24 PM
I am using the following code to update my database but it dosn't do the
update and it dosen't show any error:
SqlDataAdapter myDataAdapter=new SqlDataAdapter();
myDataAdapter.SelectCommand=new SqlCommand("select * from Alerts",conn);
DataSet alertDS = new DataSet();
myDataAdapter.FillS... more >>
|