Process.Start() C#
How would one go about starting a process on a different machine in
C#?
I see, in the documentation, how to query if a process is running on
another machine, but I do not see how to start a process on another
machine.
Thank you for any advice! Tag: Why CurrencyManager? Tag: 76788
GetTempFileName
Why am I receiving the below error when calling - Path.GetTempFileName()
The directory name is invalid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IO.IOException: The directory name is invalid. Tag: Why CurrencyManager? Tag: 76787
Custom deserialization and CollectionBase
Hello, I'm writing a custom container class using CollectionBase and I'm having some trouble with implementing the ISerializable interface so I can have some custom handling on serialization. The problem is, in the deserialization constructor, I can't set the InnerList property of the CollectionBase class as its a read only property.
Any ideas? Tag: Why CurrencyManager? Tag: 76785
CollectionBase and custom deserialization
Hello, I am writing a custom collection class that inherits from the CollectionBase class, and I have implemented the ISerializable interface as well, because I wanted to provide some custom handling of the serialization. I'm having a problem though, because I can't set the InnerList property of the CollectionBase in the deserialization constructor.
Any ideas? Tag: Why CurrencyManager? Tag: 76784
Insert XML into a XmlDocument object
I'm trying to insert XML into a XmlDocument that already has XML in it. Does anyone have some c# code examples (vb.net will work) or ideas? Thx...sonny Tag: Why CurrencyManager? Tag: 76777
Interface inheritance?
Am I correct that I can't do Interface Inheritance in C#?
What I was trying to do is have one interface (which was part of my
framework) and then have the application-specific interface inherit from
this interface and extend it as needed. I thought my application would only
need a reference to the application-specific interface (different assembly)
and that the application would have a reference to the framework-specific
interface (again, different assembly). Something like the following:
Client App ---> references Application assembly (with application
interface) --> which references Framework Assembly (with framework
interface)
ex.
Framework Interface:
public interface IRemoteObject
{
DataSet GetData();
DataSet SaveData(DataSet dataSet);
}
App-specific interface:
public interface IMethRemoteObject : IRemoteObject
{
DataSet GetPatientData();
}
However, the Client App can't see the framework interface unless I put a
reference in the CLient App to the Framework Assembly.
I guess the proper way to handle this is to put a reference to both
interfaces, and not inherit one interface from another.
I just want to make sure I am understanding what is going on (or not going
on in this case).
Thanks,
Mark Tag: Why CurrencyManager? Tag: 76770
Play music files
I have to develop an application in wich I have to play musical file, such as *.mid, *.wav, *.mp3. Is there some class in framework or somewhere that can help me ?
Thanks in advance for suggestion Tag: Why CurrencyManager? Tag: 76754
the simplest way for async events?
How can i emulate in .net that function:
BOOL PostMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);I need a simple async event firing for my WindowsForm without any
callbacks. What is the simplest way for that?thanks in advSerg. Tag: Why CurrencyManager? Tag: 76753
main menu & imagelist
Hello,
i'm working to an application for PocketPC2003, developing in c#.
I would like to create a manu with an image associated to each menu element?
Main manu doesn't support image, is it?
Any idea???
Thanks. Tag: Why CurrencyManager? Tag: 76752
Opening ILDASM.EXE programatically using C#
Hi,
I would like to open ILDASM, programatically.
I could use
System.Diagnostics.Process.Start("....\ILDASM.eXE");
But in that case i'll have to hard code the path...
which i dont want to....
any ideas on how 2 go bout doing this???
thanx in advance,
Kamelsh.
Cognizant Technology Solutions Tag: Why CurrencyManager? Tag: 76743
System.InvalidProgramException using OpCodes.Ldsfld w/Guid.Empty.
All,
I am running into an exception using IlGenerator to emit the body of a method.
The method takes a System.Guid as the only argument. I am trying to test to make sure that it isn't an empty Guid.
So, I write:
FieldInfo fi_Empty = typeof(System.Guid).GetField("Empty");
generator.Emit(OpCodes.Ldsfld, fi_Empty);
According to what I have read, this should put he value of the static field "Empty" which is of type System.Guid onto the stack.
What I get instead is an InvalidProgramException: "The Common Language Runtime has detected an Invalid Program"
Can anyone tell me what is wrong with the FieldInfo or the use of the empty Guid?
The rest of the method works fine.
My forehead and my wall both thank you in advance for any guidance. Tag: Why CurrencyManager? Tag: 76741
VB.NET Assembly denied access to System.Web. Help!
I have a VB6 Windows Form application that calls a VB.NET Assembly. I can
successfully call any test method in the assembly (like return "hello
world"), but one method in the assembly uses calls to
System.Web.HttpUtility.UrlEncode. That causes this error to be returned
back to the VB6 app:
Request for the permission of type System.Web.AspNetHostingPermission,
System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed.
I don't know if it is related to vb6 being the calling app or not. I
haven't tried working around vb6 for testing because I have to call it from
vb6 anyway. How can I resolve the above problem? I don't know much about
.net security configuration to fix this. An old newsgroup post suggested I
add this code before the UrlEncode method line, but this didn't help:
Dim Perm As New
System.Web.AspNetHostingPermission(System.Security.Permissions.PermissionSta
te.Unrestricted)
Perm.Assert()
What can I do to fix this security problem? Tag: Why CurrencyManager? Tag: 76728
dotnetfx.exe for ANSI C ???
Okay somebody tell me I'm not going crazy.
I've written a straight ANSI C program using .net devstudio but it won't run on any other machine unless it has dotnetfx.exe installed??
Is this some kind of stupid joke? All I want is a stand alone .exe...why would I want to have my users install more microsoft crap just to run a basic .exe??
Anybody know how to build a real stand alone .exe using .NET devstudio?
How stupid can microsoft get? .NET blows... Tag: Why CurrencyManager? Tag: 76724
Inserting a blob into oracle from a file
Everytime I try to inset a blob from a file I get the following error.
ORA-12571: TNS:packet writer failure.
I was able to successful insert a blob from a post to another another
page using the PostedFile object. But for some reason this will not
work for a file.
Below is the code that I tried:
// provide read access to the file
FileStream fs = new FileStream(newFileName,
FileMode.Open,FileAccess.Read);
// Create a byte array of file stream length
byte[] newFileBuf = new byte[fs.Length];
fs.Read(newFileBuf,0,System.Convert.ToInt32(fs.Length));
//Close the File Stream
fs.Close();
try
{
OleDbConnection cn = new OleDbConnection(strConnect);
OleDbCommand cmd = new OleDbCommand("INSERT INTO TESTBLOB
(NewFile,ID) VALUES (?, 1)", cn);
OleDbParameter prm1 = new OleDbParameter("@NewFile",
OleDbType.LongVarBinary, newFileBuf.Length, ParameterDirection.Input,
false, 0, 0,null, DataRowVersion.Current, newFileBuf);
cmd.Parameters.Add(prm1);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
}
catch(Exception ex)
{
label1.Text = ex.Message;
}
when I use replace the top with this:
Stream myStream = Invoice.PostedFile.InputStream;
byte[] newFileBuf= new byte[Invoice.PostedFile.ContentLength];
myStream.Read(newFileBuf, 0, Invoice.PostedFile.ContentLength); Tag: Why CurrencyManager? Tag: 76722
Can Collection/Array be used as a Trace/Debug Listener?
I am a C# newbie. In VB i had developed an infrastructure
that allowed recent trace/debug information to be kept in
memory. I would like to do similar in .Net. Is it
possible? or will i have to write my own code? From what i
have read in the Microsoft books and documentation it
seems that a Trace Listener can only be a stream, like
writing to a disk file. But i don't want to capture all
trace events to an external file or db, but store only
some trace events in memory so to be available to an error
handler. Example, application will retain the last 100
trace events in memory; when exception occurs, central
error handler dumps trace information and creates error
report. Can this scenario work with the Trace/debug
classes? What is the How To?
Thank you Tag: Why CurrencyManager? Tag: 76721
EventLog problem
When I run the VB=2ENET program below, the entry below appears in=
the "Application" log=2E
The "ServOneLog" log is created, but it is empty=2E I am trying to=
write to the "ServOneLog"=2E
Why doesn't this work??
Application log entry:
The description for Event ID ( 0 ) in Source ( ServOne ) cannot=
be found=2E The local computer may not have the necessary registry=
information or message DLL files to display messages from a=
remote computer=2E You may be able to use the /AUXSOURCE=3D flag to=
retrieve this description; see Help and Support for details=2E The=
following information is part of the event: LogWorker succeeded=
in writing to ServOneLog=2E=2E
Program:
Module Module1
Dim el As EventLog
Public Const LOG_NAME As String =3D "ServOneLog"
Public Const LOG_SOURCE As String =3D "ServOne"
Sub Main()
Dim appLog As New EventLog("Application")
appLog=2EClear()
If (System=2EDiagnostics=2EEventLog=2ESourceExists(LOG_SOURCE))=
Then
EventLog=2EDeleteEventSource(LOG_SOURCE)
End If
If System=2EDiagnostics=2EEventLog=2EExists(LOG_NAME) Then
System=2EDiagnostics=2EEventLog=2EDelete(LOG_NAME)
End If
If (Not=
System=2EDiagnostics=2EEventLog=2ESourceExists(LOG_SOURCE)) Then
EventLog=2ECreateEventSource(LOG_SOURCE, LOG_NAME)
End If
el =3D New EventLog(LOG_NAME)
el=2ELog =3D LOG_NAME
el=2ESource =3D LOG_SOURCE
el=2EWriteEntry(LOG_SOURCE, "LogWorker succeeded in writing=
to ServOneLog=2E")
End Sub
End Module
--------------------------------
From: Bob Anderson
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>JODidyvdI02KsawrjFpZkA=3D=3D</Id> Tag: Why CurrencyManager? Tag: 76720
ECMA-335: How to decode PackedLen
MetaData specification (ECMA-335) contain PackedLen values.
But PackedLen not described in specification.
How to decode it?
Thanks,
Alex. Tag: Why CurrencyManager? Tag: 76718
Can multiple callers to WaitHandle::WaitAll deadlock?
Hi,
Can two callers to WaitHandle::WaitAll reach a deadlock if their array's contain the same WaitHandles in different orders?
For example
Client One:
WaitHandle.WaitAll ( new WaitHandle[] { wh1, wh2, wh3 } )
Client Two:
WaitHandle.WaitAll ( new WaitHandle[] { wh3, wh2, wh1 } )
Can these two clients reach deadlock if Client One receives the signal for wh1 and Client Two receives a signal for wh1, or will WaitAll protect against this?
Thanks,
-Mike Tag: Why CurrencyManager? Tag: 76717
Domain property of NetworkCredential class
I'm trying to provide flexible support of various HTTP proxy servers in my
web client app, and need to understand in what situations the various proxy
authentication properties are used...
Specifically, what should the Domain property of the NetworkCredential class
be set to when using WebProxy?
I'm testing against an Apache 2 proxy server, which is set to basic
authentication, with the name of its realm set to "Proxy Server".
When I don't set the Domain property of my NetworkCredential object, my
WebRequest.GetResponse works OK.
But when I set Domain to "Proxy Server" (which I expected to be required)...
I get HTTP 407.
So what exactly does the Domain specify? When is it used?
Code fragment below.
Thanks,
David Thom
Dim myWebRequest As WebRequest =
WebRequest.Create("http://www.microsoft.com")
Dim myWebProxy = New WebProxy
myWebProxy.Address = New Uri(http://10.0.2.6) ' the Apache proxy server
Dim myCredentials As New NetworkCredential
myCredentials.UserName = "user"
myCredentials.Password = "password"
' myCredentials.Domain = "Proxy Server" ' GetResponse works if I don't set
Domain property
myWebProxy.Credentials = myCredentials
myWebRequest.Proxy = myWebProxy
Dim myWebResponse As WebResponse = myWebRequest.GetResponse() Tag: Why CurrencyManager? Tag: 76716
TypeLoadException / ExecutionEngineException VS2003 $$struct ... bug ? (SOLVED!)
Hi,
I encountered a bug in VS2003.
At a certain moment, when building an executable, the build executable
was buggy (.NET 1.1 framework). When running, it immediately (before
executing user code) throws a ExecutionEngineException (run in VS2003)
or TypeLoadException (run stand-alone). The bug was proven when I
ildasm-ed it an tried to ilasm it: ilasm failed.
Also, when I solved the problem (by throwing away the obj-directory,
so the problem must have been related to the incremental build
proces), the differences between the buggy and the correct build
became apparent by examining the metadata.
It appeared that the good version had a struct in it which was wrapped
in a <PrivateImplementationDetails> class, while the bad version was
wrapped in my application class. (the good IL is shown at the bottom).
This struct, by the way, was autogenerated by the compiler and
contains some hardcoded data (a fixed array).
Maybe this is of any use to anybody.
Kind regards,
Edwin van de Burgt.
(please reply to the newsgroup only. Above email-address is not
used)
-----------
.class private auto ansi '<PrivateImplementationDetails>'
extends [mscorlib]System.Object
{
.class explicit ansi sealed nested private '$$struct0x6000034-1'
extends [mscorlib]System.ValueType
{
.pack 1
.size 18
} // end of class '$$struct0x6000034-1'
.field static assembly valuetype
'<PrivateImplementationDetails>'/'$$struct0x6000034-1'
'$$method0x6000034-1' at D_00004260
} // end of class '<PrivateImplementationDetails>' Tag: Why CurrencyManager? Tag: 76715
How to decode PaskeLen?
MetaData specification (ECMA-335) contain PackedLen values.
But PackedLen not described in specification.
How to decode it?
Thanks,
Alex. Tag: Why CurrencyManager? Tag: 76712
Inserting XML into a XmlDocument object
I have a XmlDocument object that has data in it already and I want to add 1 or more sections into the XmlDocument. Are there any c# (vb.net will work) examples or ideas anyone willing to share? Thanks...sonny Tag: Why CurrencyManager? Tag: 76711
Regexp Validation
Oh great Regular Expression gurus - I summon thee...
I am using the regular expression validator...
I know this is probably about as trivial as it gets for someone with
regular expression experience, but I don't. I was wondering if
someone would be able to create a regular expression (for validating
user passwords) that matches the following:
All of the following must be true for a match:
6-12 length - Isn't it something like {6,12}
Must include 1 or more lowercase - [a-z]
Must include 1 or more uppercase - [A-Z]
Must include 1 or more numeric - [0-9]
That's it, from the little I know, those are the patterns that it
should use, but I have no idea how to create the full statement.
TIA!
JB Tag: Why CurrencyManager? Tag: 76710
Sorting Problem
I need to sort an XML subtree using a value in a different matching subtree
in the same document.
The XSLT syntax I am using is (indented so that sort select and VAL
definition line up:
<xsl:for-each select='LABITEM0'>
<xsl:sort select='ancestor::TABLE/DATA/DIMN[@idx=current()/
@dimn_idx]/DIMN[@idx=$RANKCOL_IDX]/CELL/ITEM[contains($FIGTYPE,@class)][1]'
order='descending' data-type='number'/>
<xsl:variable name='VAL' select='/TABLE/DATA/DIMN[@idx=current()/
@dimn_idx]/DIMN[@idx=$RANKCOL_IDX]/CELL/ITEM[contains($FIGTYPE,@class)]
[1]'/>
<xsl:copy>
<xsl:copy-of select='@*'/>
<xsl:attribute name='ORD'><xsl:value-of select='position
()'/></xsl:attribute>
<xsl:attribute name='VAL'><xsl:value-of select='$VAL'/>
</xsl:attribute>
<xsl:copy-of select='*'/>
</xsl:copy>
</xsl:for-each>
This works fine using another XSLT processor (xsltproc)
BUT IS RETURNED UNSORTED (i.e. in original document order) using
XslTransform (and also msxml (4.0) from the command line).
The VAL attribute is correctly set - so I am pointing to the right values.
I've tried other sorts that do not use a path starting at the document root
and they seem to work OK.
Can anyone tell me why this isn't working - or suggest a sort select syntax
that would work? Tag: Why CurrencyManager? Tag: 76703
Debug options
Does anyone know a way to NOT have the debugger debug javascript when going through ASP.Net code? I need to debug some code server side but I keep getting caught on some javascript error that never presents itself when running normally but seems to have some problem in the debugger. All I want to do is debug my VB and forget the javascript but it won't let me. I can't even step over the javascript block giving me hell. Tag: Why CurrencyManager? Tag: 76699
serialization bug
Hi,
Could someone please confirm the following?
I think I have found a subtle .NET serialization bug. It occurs when object
has a list of items containing another object of the same type and both
objects have a non-static member reference to some other static object. In
this case, I get an InvalidArgument exception when I try to access the
non-static member of the child class. I've included a code sample to
clarify. This "bug" is causing a major problem for me. So, if anyone could
confirm it or let me know if I'm doing something wrong, I would be very
appreciative.
Thanks,
Aaron
Here is the sample
[Serializable]
public class A {
private ArrayList children;
private static Pen DPEN = Pens.Black;
private Pen pen = DPEN;
public A() {
children = new ArrayList();
children.Add(new D());
}
public void AddChild(A a) {
children.Add(a);
}
public A Child {
get { return (A)children[0]; }
}
public Pen Pen {
get { return pen; }
}
}
public class PenSurrogate : ISerializationSurrogate {
public void GetObjectData(Object obj, SerializationInfo info,
StreamingContext context) {
Pen pen = (Pen)obj;
info.AddValue("pencolor", pen.PenType == PenType.SolidColor ? pen.Color :
Color.Empty);
}
public Object SetObjectData(Object obj, SerializationInfo info,
StreamingContext context, ISurrogateSelector selector) {
return (Pen)info.GetValue("pencolor", typeof(Pen));
}
}
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
A a = new A();
A an = new A();
a.AddChild(an);
BinaryFormatter bFormatter = new BinaryFormatter();
SurrogateSelector s = new SurrogateSelector();
s.AddSurrogate(typeof(Pen), new
StreamingContext(StreamingContextStates.All), new PenSurrogate());
bFormatter.SurrogateSelector = s;
MemoryStream stream = new MemoryStream();
bFormatter.Serialize(stream, a);
stream.Seek(0, SeekOrigin.Begin);
A copy = (A)bFormatter.Deserialize(stream);
System.Console.WriteLine(copy.Pen.Color.ToString());
System.Console.WriteLine(copy.Child.Pen.Color.ToString()); //Causes an
InvalidArgument Exception
} Tag: Why CurrencyManager? Tag: 76697
Problems with Compiling COM - newbie
HI,
I am having problems trying to compile a vb class, the code is below.
For some reason it doesn't recognise the namespaces, Data, or
Data.SqlClient.
In Visual Studio I have created a reference to System.Data, and
appears under references, but I can't seem to create one for
System.Data.SqlClient as it doesn't appear in the selection.
Another thing I should mention is that I am copying the vb class file
from our dev server onto my own machine and compiling it on my machine
using the VS.net compiler. I intend to copy and paste the dll into bin
on the dev server after.
What am I doing wrong??????
Thanks
Angela
-------------CODE-----------------------
Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class SQLTest
Public Shared Sub DeleteService(ByVal name As String, ByVal
strConnection As String)
Dim conPortal As New SqlConnection(strConnection)
Dim cmd As New SqlCommand("AdminDeleteService", conPortal)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@communityID", strConnection)
cmd.Parameters.Add("@name", name)
conPortal.Open()
cmd.ExecuteNonQuery()
conPortal.Close()
End Sub 'DeleteService
End Class Tag: Why CurrencyManager? Tag: 76695
Best way to sent byte[] parameter to unmanaged code?
Using C#, I want to send a byte array to an unmanaged function with the
minimum amount of copies. The array is input only and won't be modified
(its copied on the unmanaged side).
I'm currently using fixed byte *. My question is: Should I be using In
byte[] parameter instead? Ref parameter?
fixed( byte *b = byte_array ) {
MyUnmangedFunc2( b, byte_array.Length );
}
[DllImport("foo.dll")] private static extern unsafe void MyUnmanagedFunc2(
byte *val, int count );
--OR--
MyUnmanagedFunc2( byte_array, byte_array.Length );
[DllImport("foo.dll")] private static extern unsafe void MyUnmanagedFunc2(
In byte[] val, int count );
I need a solution for both the compact framework and desktop framework.
(Don't have to be the same but closer the better)
Thanks,
Philippe Tag: Why CurrencyManager? Tag: 76692
keybd_event in C#
How to use keybd_event api function in c# for combination keys
eg. ctrl+shift +s
I tried like
keybd_event(0x11,0x1D,0,0)
keybd_event(0x10,0xAA,0,0)
keybd_event(0x53,0x1F,0,0)
keybd_event(0x53,0x1F,0x0002,0)
keybd_event(0x10,0xAA,0x0002,0)
keybd_event(0x11,0x1D,0x0002,0)
but it doesn't work
-kannan Tag: Why CurrencyManager? Tag: 76691
Stuck on problem using Serialization
This is what I have produced so far...
<?xml version="1.0" encoding="utf-8"?>
<Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Tables>
<Table>
<NameOfTable>Table</NameOfTable>
<Columns>
<Column Name="Col_1">New_Col_1</Column>
<Column Name="Col_2">New_Col_2</Column>
<Column Name="Col_3">New_Col_3</Column>
<Column Name="Col_4">New_Col_4</Column>
<Column Name="Col_5">New_Col_5</Column>
</Columns>
</Table>
</Tables>
</Database>
I want
<NameOfTable>Table</NameOfTable>
in the form of
<NameOfTable Name="Table">NewTableName</NameOfTable>
and am having difficultly doing so.
I can get the form that I am looking for with the Columns because it is
an ArrayList. The NameOfTable is not. It is just a single Element.
Here is the code that produced the results above. I am attempting to
add in the TableName class to solve this problem but am not having
any luck in getting it to print out. It never hits the getter.
Any help is appreciated.
Dave
[XmlInclude(typeof(TableName))]
public class DatabaseTable
{
private TableName tableName;
private string name;
private string className;
private ArrayList columns = new ArrayList();
[XmlElement]
public string NameOfTable
{
get { return (name); }
set { name = value.Trim(); }
}
[XmlArray(ElementName = "Columns")]
[XmlArrayItem(ElementName = "Column", Type = typeof(DatabaseTableColumn))]
public ArrayList Columns
{
get {return (columns); }
}
[XmlElement(Type = typeof(TableName))]
public TableName MyTableName
{
get {return (tableName); }
}
}
public class TableName
{
private string dbName;
private string newName;
public TableName()
{
}
[XmlAttribute]
public string Name
{
get { return (newName); }
set { newName = value.Trim(); }
}
[XmlText(Type=typeof(string))]
public string NameOfDbColumn
{
get { return (dbName); }
set { dbName = value.Trim(); }
}
} Tag: Why CurrencyManager? Tag: 76683
Remote Counter Monitoring using Perfmon
I don't know whether this is the right list....but we have configed our application to run on rpoduction environment and accoridng to KB Article ID 158438 - Enabling Non-Admin Users to remotely monitor with perfmon.. we have executed the required steps on production box...
Teh problem is we can access all system counters from remote machien but when we go thru .NET Counters or any custom counters those values don't get displayed. on remote machine...
Any special permission required for custom counters
Regards
Yogesh S Tag: Why CurrencyManager? Tag: 76682
ANN: Reminder: Compact Framework chat today
Just a note that we'll be hosting an online chat this morning concerning
Smart
Device Programming with Visual Studio .NET 2003. We will be on hand ready
to
answer your questions, so bring 'em on!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: Smart Device Programming with Visual Studio .NET 2003
Chat Date: June 10th
10:00am - 11:00am Pacific Time
1:00pm - 2:00pm P.M. Eastern time
17:00 - 18:00 GMT/BST
Description: You know them from the newsgroups! You love them for their
immense knowledge! Please join these amazing Microsoft MVPs in this live
chat regarding the .NET Compact Framework and the Smart Device Programming
features of VS.NET. The .NET Compact Framework is a subset of the .NET
Framework designed to allow .NET developer to target smart devices. The
Smart Device Programming features of VS.NET allow embedded developers to
target devices running the Compact Framework.
To join this chat, please log on via the main MSDN chat page at:
http://msdn.microsoft.com/chats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--
--
Thanks!
Michael Fosmire
Community PM/MVP Lead, Windows Embedded
This posting is provided AS IS with no warranties, and confers no rights. Tag: Why CurrencyManager? Tag: 76681
calling a class defined in an ASP.NET project from windows application
Hi,
I'm working on a web project and i create classes to do business logic and
connect to DB.
i also need a windows application to do the same functionality as defined
in classes inside the ASP.NET project.
when i reference the web project DLL (inside the BIN directory) I
successfully make a call to a function and get return value.
but this is just a test and when trying to access the application
configuration information (defined in web.config) i get empty string in
return.
is there a way to share functionality between web and windows/service
projects?
TIA, zigi. Tag: Why CurrencyManager? Tag: 76680
Refection/Serialization Problems
Hi,
I'm trying to build a gerenic routine which deals with versioning problems
between serailized objects. All my objects are Serialized into a SQL
server DB, but I need to make changes to the object tree and also make
future changes easier.
I'm using custom serialization and reflection and I think I'm getting there,
but I have a wierd problem. I've extracted all the properties from the
object in question and passed the info to the following VB routine. It's
working fine until it encounters an invalid member in the serializationinfo
(which is expected - it's a newly added property in my object), but after
that it never recovers - from that point on I'm getting a
serializationexeption (member <name> not found) for each subsequent property
even when the member definitely exists in the serializationinfo. This only
happens AFTER the expected error, until then it's fine.
Any clues?
Thanks,
Russ
Private Shared Function CopyObject(ByVal Info As SerializationInfo, ByVal
PI() As PropertyInfo, ByRef O As Object)
Dim P As PropertyInfo
For Each P In PI
Try
P.SetValue(O, Info.GetValue(P.Name, P.PropertyType), Nothing)
Catch ex As Exception
End Try
Next
Return O
End Function Tag: Why CurrencyManager? Tag: 76673
rtd
hi
i have an excel sheet which is being populated with real time data using DDE links. i want to access this data in my C# program. How can i create a RTD client in C#? what is the other way out in C#? i have checked KB articles, but no reference is given on RTD clients, only RTD servers are given. plz help. Tag: Why CurrencyManager? Tag: 76672
real time data client in c#
hi
i have an excel sheet which is being populated with real time data using DDE links. i want to access this data in my C# program. How can i create a RTD client in C#? what is the other way out in C#? i have checked KB articles, but no reference is given on RTD clients, only RTD servers are given. plz help. Tag: Why CurrencyManager? Tag: 76671
Real time data
hi..
i have an excel sheet which is being filled with real time data using DDE links.
i want to access this data in my c# program. how can i make an RTD client? what is the other way out in C#? Tag: Why CurrencyManager? Tag: 76670
EditorAttribute and ReadOnlyAttribute
Hi,
When I use BOTH ReadOnlyAttribute and EditorAttribute for a property it's for some reason NOT read only as I expected.
If I don't use the EditorAttribute it's read only.
Someone know more about why it's not read only when EditorAttribute used?
The object with the property is used in a PropertyGrid and it's when PropertyGrid is displayed the property unexpectedly is not read only. Tag: Why CurrencyManager? Tag: 76669
.NET publish/subscribe support
Can anyone tell me if .NET directly supports the publish/subscribe messaging paradigm. If not directly, are there add-ons available that will provide this type of functionality?
Thanks in advance,
Russ
--------------------------------
From: Russ Goetz
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>hQf1RHAVfU2zhCQX5lyolg==</Id> Tag: Why CurrencyManager? Tag: 76668
service timer event WaitHandleWaitOne
Hi there all, hope someone recognises this.
Problem summary:
I have a problem using a timer object within my service class. Whilst the timer triggers happily with delay of 30000 ms for some hours, it eventually comes to a point where no further work is done.
Background:
I have a service that (when started) I wish to check for work to do every 30 seconds. Therefore I have created a service class with a timer (system.Timers.Timer) and also an object of my service worker class.
In the OnStart method I create a new instance of my worker class and load it's configuration. I set the timer interval (held as part of worker's config) and set the timer delay.
On each timeout of the timer the timer_elapsed method runs. This stops the timer, does the work using the worker class, starts the timer and then sleeps again.
Repeat.
The service always appears to be running (in service manager shows as Started) and in task manager the exe process itself is running, but no CPU.
If I connect via Visual Studio to the process I cannot get it to hit a breakpoint anywhere. But if I "cheat" and connect to a second service (i.e. another custom process and stop the code in breakpoint relating to that service) then I can see that Visual Studio debugger believes that four threads are running that relate to my app:
1) At the final } statement of my service class.Main method and
2) In System.Threading.WaitHandle.WaitOne
3) & 4) have "no code associated"
This second thread leads me 'only' to some disassembly. But no further.
Deadlock?
As hinted at above: 3 further services run on the same machine and these share a similar format (triggered at time interval) and some code libraries between them.
Could anyone point me towards a possible solution or, perhaps more likely, a way to identify further actions towards a solution.
Many thanks
Matt
serviceworker = new CServiceWorker(intLogLevel);
System.Timers.Timer sleepTimer = new
static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new ServiceClassName() };
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
}
private void InitializeComponent()
{
this.sleepTimer = new System.Timers.Timer();
((System.ComponentModel.ISupportInitialize)(this.sleepTimer)).BeginInit();
this.sleepTimer.Elapsed +=new System.Timers.ElapsedEventHandler(sleepTimer_Elapsed);
this.ServiceName = "ServiceClassName";
((System.ComponentModel.ISupportInitialize)(this.sleepTimer)).EndInit();
}
protected override void OnStart(string[] args)
{
// do some reading of args and load configuration
// create new instance of worker class
serviceworker = new CServiceWorker(intLogLevel);
long lngTimerIntervalSecs = serviceworker.getTimerIntervalSecs();
setTimerInterval(lngTimerIntervalSecs);
}
private void setTimerInterval(long lngTimerIntervalSecs)
{
long lngTimerSleepPeriodMilliSecs = 1000 * lngTimerIntervalSecs;
this.sleepTimer.Interval = lngTimerSleepPeriodMilliSecs;
// trigger first instance of timer
this.sleepTimer.Enabled = true;
sleepTimer.Start();
}
private void sleepTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
sleepTimer.Stop();
sleepTimer.Enabled = false;
// do all the stuff each time timer trigger
if(serviceworker.executeMainActivity())
{
// execute ok - try again in 30 seconds
sleepTimer.Start();
sleepTimer.Enabled = true;
}
else
{
// handling removed, but ...
// doesn't matter if execute failed - try again in 30 seconds
sleepTimer.Start();
sleepTimer.Enabled = true;
}
}
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching. Tag: Why CurrencyManager? Tag: 76667
service timer event WaitHandleWaitOne
Hi there all, hope someone recognises this.
Problem summary:
I have a problem using a timer object within my service class. Whilst the timer triggers happily with delay of 30000 ms for some hours, it eventually comes to a point where no further work is done.
Background:
I have a service that (when started) I wish to check for work to do every 30 seconds. Therefore I have created a service class with a timer (system.Timers.Timer) and also an object of my service worker class.
In the OnStart method I create a new instance of my worker class and load it's configuration. I set the timer interval (held as part of worker's config) and set the timer delay.
On each timeout of the timer the timer_elapsed method runs. This stops the timer, does the work using the worker class, starts the timer and then sleeps again.
Repeat.
The service always appears to be running (in service manager shows as Started) and in task manager the exe process itself is running, but no CPU.
If I connect via Visual Studio to the process I cannot get it to hit a breakpoint anywhere. But if I "cheat" and connect to a second service (i.e. another custom process and stop the code in breakpoint relating to that service) then I can see that Visual Studio debugger believes that four threads are running that relate to my app:
1) At the final } statement of my service class.Main method and
2) In System.Threading.WaitHandle.WaitOne
3) & 4) have "no code associated"
This second thread leads me 'only' to some disassembly. But no further.
Deadlock?
As hinted at above: 3 further services run on the same machine and these share a similar format (triggered at time interval) and some code libraries between them.
Could anyone point me towards a possible solution or, perhaps more likely, a way to identify further actions towards a solution.
Many thanks
Matt
serviceworker = new CServiceWorker(intLogLevel);
System.Timers.Timer sleepTimer = new
static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new ServiceClassName() };
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
}
private void InitializeComponent()
{
this.sleepTimer = new System.Timers.Timer();
((System.ComponentModel.ISupportInitialize)(this.sleepTimer)).BeginInit();
this.sleepTimer.Elapsed +=new System.Timers.ElapsedEventHandler(sleepTimer_Elapsed);
this.ServiceName = "ServiceClassName";
((System.ComponentModel.ISupportInitialize)(this.sleepTimer)).EndInit();
}
protected override void OnStart(string[] args)
{
// do some reading of args and load configuration
// create new instance of worker class
serviceworker = new CServiceWorker(intLogLevel);
long lngTimerIntervalSecs = serviceworker.getTimerIntervalSecs();
setTimerInterval(lngTimerIntervalSecs);
}
private void setTimerInterval(long lngTimerIntervalSecs)
{
long lngTimerSleepPeriodMilliSecs = 1000 * lngTimerIntervalSecs;
this.sleepTimer.Interval = lngTimerSleepPeriodMilliSecs;
// trigger first instance of timer
this.sleepTimer.Enabled = true;
sleepTimer.Start();
}
private void sleepTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
sleepTimer.Stop();
sleepTimer.Enabled = false;
// do all the stuff each time timer trigger
if(serviceworker.executeMainActivity())
{
// execute ok - try again in 30 seconds
sleepTimer.Start();
sleepTimer.Enabled = true;
}
else
{
// handling removed, but ...
// doesn't matter if execute failed - try again in 30 seconds
sleepTimer.Start();
sleepTimer.Enabled = true;
}
}
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching. Tag: Why CurrencyManager? Tag: 76666
what's the prospect of MMC?
what's the prospect of MMC(Microsoft Management Console)?How will microsoft develop it in the future's plan and .NET solution? Tag: Why CurrencyManager? Tag: 76663
what's the prospect of MMC?
what's the prospect of MMC(Microsoft Management Console)?How will microsoft develop it in the future's plan and .NET solution? Tag: Why CurrencyManager? Tag: 76662
ANN: RemObjects Internet Pack for .NET public beta
Hello everyone,
RemObjects Software is pleased to announce that the public beta of the
Internet Pack for .NET is now available for download.
Internet Pack for .Net (IP) is the new lightweight and flexible network
development framework developed 100% using native C# code. IP supports the
Microsoft .NET Frameworks 1.1 and 2.0 (May Preview), the Compact Framework,
and Mono (Beta 2). Supported development IDEs include Visual Studio 2003,
2005 (May Preview), and Borland Delphi 8.
Internet Pack for .NET is free and includes full source code.
STATUS
IP is currently in "stable beta" status. This means that we consider the
current build to be stable enough to be used in production projects and
day-to-day development, but we're planning to incorporate more features and
possible fixes in the near future before releasing the "final" version.
FEATURES
IP is a work in progress, and our goal for version 1.0 was to provide a
high-quality framework rather than a large amount of different protocol
implementations.
Some of the features available in the first release of IP include:
- Lightweight and comfortable to use base framework
- Flexible and highly scalable architecture
- Extendable Connection class allows you to easily integrate
custom encryption or compression solutions
- Extendable HTTP Client and Server framework - build HTTP applications
with just a few lines of code, or easily expand the components to provide
complex custom solutions
- Extendable FTP Server framework and VirtualFTP sample implementation
- CommandBasedServer and Client based components allow you to easily
implement your own command based protocols (such as SMTP, FTP
Command Connection, etc.)
- SimpleHttpServer component provides an easy to implement file-based
HTTP Server
- SMPT and POP3 Client implementation, Mail Message encapsulation classes
- Integration with upcoming DebugServer 3 for easy debugging and tracing
DEVELOPMENT COMMUNITY
Over time, Internet Pack will become a community project, and we hope that
many of its users will contribute with their own extensions and components
to the project. Check the urls and newsgroup listed below for more
information.
ADDITIONAL INFORMATION & DOWNLOAD
Download your copy of Internet Pack now, or find more information about the
library at http://www.remobjects.com?ip.
Our news server is open for discussions about IP (both for users and
co-developers) at
news://news.remobjects.com/remobjects.public.internetpack.net.
Also check out the RemObjects Blogs at http://research.remobjects.com/blogs
for regular news and thoughts on the development and progress of IP.
We hope that you will enjoy using Internet Pack as much as we have enjoyed
creating it, and we look forward to your feedback and comments.
The RemObjects Team
http://www.remobjects.com Tag: Why CurrencyManager? Tag: 76658
Newbie Namespace Question
Hi,
The following code snippet doesnâ??t compile with,
helloworld.cs(25,39): error CS0246: The type or namespace name 'Library' could not be found (are you missing a using directive or an assembly reference?)
Why canâ??t the â??Libraryâ?? namespace be found when its location â??Company.Applicationâ?? has been referenced in the Tester class.
using System;
namespace Company.Application.Library
{
class Math
{
public static int Add(int a, int b)
{
return(a + b);
}
}
}
namespace Test
{
using Company.Application;
class Tester
{
static void Main()
{
int iResult = Library.Math.Add(2, 2);
Console.WriteLine(iResult);
}
}
} Tag: Why CurrencyManager? Tag: 76652
How to identify an error?
Hi,
I want my application do different actions depending on the exception it
gets.
For exemple: I have an SQL-table with a unique index. In case I try to
Insert a record that's alreaddy in it I get this exception: "Cannot insert
duplicate key row in object 'tblTelephones' with unique index
'UniqueValues'."
What I'm looking for is a way to identify the exception: in case I get this
exception I want to do this, in case of another I want to do that.
The most simple solution to me seems this:
Catch ex As Exception
If Left(ex.Message, 41) <> "Cannot insert duplicate key row in
object" Then
'do this action
End If
QAlthough, I'm not convinced this is the best way. Is there a way to
identify the exception with a unique number? Or I've seen once something
like a name for an error. Can anybody help me with this?
Thanks a lot in advance
Pieter Tag: Why CurrencyManager? Tag: 76647
Web service doesn't run
When i open the .asmx file with IE the IIS server doesn't run the web
service but instead i am prompted by the web browser to open the .asmx file
(that is it is getting downloaded). The same happens with the default Hello
World web service. I am using VS 2003 and Windows XP SP1 (with its IIS
server).
Any ideas?
Regards,
Ioannis Vranos Tag: Why CurrencyManager? Tag: 76646
Is MSWINSCK.ocx part of
the .NET framework? I keep getting an error that tells me "Component
MSWINSCK.OCX or one of its dependencies not correctly registered: a file is
missing or invalid" I have downloaded the .NET framework from windows update
and have since downloaded all available updates, including service pack 2.
Not sure if this makes a difference, but I reinstalled everything, installed
service pack 1, then 2, then did all the remaining updates and am getting
this error... Tag: Why CurrencyManager? Tag: 76644
Is this possible to do with a script or CMD line
Hello frameworkers!
im trying to TrustAnAssembly when installing an application. Unfortunately
im a beginner in .NET Framework and Security.Config
I believe i should use CASPOL.EXE and SN.EXE or AL.EXE but i cant get i
working
My hope right now stand for the framework experts in this forum.
The steps i need to do with a script or CMD line
i run ConfigWizards.exe
choose "Trust an Assembly"
"Make Changes to this computer"
Enter the url for my app "//provisioprog/provisio/provisioadm.exe"
All Assemblies with the same assembly public key
Uncheck the "include version number
Choose full trust
Then this ends up in my security.config file and the application works fine.
CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Provisio"
Description="">
<IMembershipCondition
class="StrongNameMembershipCondition"
version="1"
PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000
100773D0F8D43BF49BE2CE450478AED753A1118FB32BF30A1E8E2387E75100E592690AADF566
5623F498158945C634A7613BC3E91F9003543CA22A161111CCB5D064647559D3B2D9FBFD2B63
ECD2CFA7BDB6BED88CB173B9B180EA4F4A6673D59A46B7BBF949DCF13E2116A8F64DB966955E
1E381BF3B688DDBF1690C4875CF8BBF"/>
</CodeGroup>
Regards / Lelle Tag: Why CurrencyManager? Tag: 76642
Anybody nows a reason why System.Windows.Forms.CurrencyManager is being called that way?