Visual Studio 2005 sp1
Has anyone managed to install this services pack?
I have tried on several computers and it complains that it can't find Visual
Studio!
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.) Tag: Change group name witn wmi or adsi Tag: 123343
Get a process's child process
Hi,
Is there a way to get the current process's child processes?
Or given a user, get all the processes that are running as that user using
C#?
Thank you in advance!
Agnes Tag: Change group name witn wmi or adsi Tag: 123336
Program Userform to search, find and update the current info.
I have achieved the first goal which is to be able to search and find
data stored in the excel workbook. Now I need to find a way to upadate
the data that was found, example:
find; chris, chris found, now i need to add a last name to chris in the
second column of the excel sheet when chris is at the first column.
Does anyone know a way that this can be achieved! Tag: Change group name witn wmi or adsi Tag: 123334
[2.0] Hide a console application
Hi, I have a console application and I would like to hide it when it's running.
Of course I took a look into the StartInfo property of the Process Class
(CreateNoWindow, WindowsStyle) but when I start my application, the dos
windows is still visible.
Process p = Process.GetCurrentProcess();
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
This application is started by an other program which is not developped in
.NET so I can't create a ProcessStartInfo object and set CreateNoWindow and
WindowsStyle. Anyway I haven't source code.
Does someone have an idea or the solution for me ?
Thanks
Fred Tag: Change group name witn wmi or adsi Tag: 123325
Difference between ArrayList and List<object> ?
Hello,
Is there any difference between ArrayList and List<object> ? Which
one should I use ?
Thanks. Tag: Change group name witn wmi or adsi Tag: 123317
Namespace to manipulate mp3 files in 1.1
Hi folks
Is there a namespace in the framework 1.1 to manipulate audio files (mp3).
The sort of functionality I am after is the ability to be able to select a
certain section of a file according to a specific start time from the
beginning of the file and length of time from that start time then saving
that particular section.
Also, I need to be able to concatenate two files together.
Kind regards
Ross Petersen Tag: Change group name witn wmi or adsi Tag: 123316
Question: Using STA component in threadpool via delegate.BeginInvo
Hi,
I have a couple of questions relating to STA component that has been bugging
me.
If I have a STA component and I want to call one of its methods, which takes
some times to complete and so I want to run it on a threadpool by using
delegate.BeginInvoke().
Questions:
1) What kind of Apartment are the threads in the threadpool?
2) In legacy COM programming, I need to manually marshal the COM interface
pointer to the other Apartment.
If I simply pass the interface in .Net as a parameter when I call the
delegate.BeginInvoke(), will .Net marshals the interface for me?
If not, how do I to do this correctly?
Thanks.
Leon Tag: Change group name witn wmi or adsi Tag: 123315
problem with tooltip on 2.0 framework
Hi all,
I am experiencing a strange problem for the call setToolTip while
running my application on frmaework 2.0. I have found 2 messages on
google discussing the same issue but there are
no replys
It dumps saying something like
System.InvalidOperationException: Adding the tip to the native ToolTip
control did not succeed.
at System.Windows.Forms.ToolTip.SetToolInfo(Control ctl, String
caption)
at System.Windows.Forms.ToolTip.CreateRegion(Control ctl)
at System.Windows.Forms.ToolTip.CreateAllRegions()
at System.Windows.Forms.ToolTip.get_TopLevelControl()
at System.Windows.Forms.ToolTip.CreateRegion(Control ctl)
at System.Windows.Forms.ToolTip.HandleCreated(Object sender,
EventArgs eventargs)
at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
The strange thing about this that it cannot be caught in the try catch
blocks.
Actually I have set the tooltip to most of the controls in my
application. It sets and displays it properly but somewhere in the
middle it dumps. The trace I am getting won't tell me exactly to which
tooltip it dumps so I am not able to figure out exactly.
Does anybody has found any solution for such problem
Thanks in advance Tag: Change group name witn wmi or adsi Tag: 123314
Directory Structure to XML DOM?
I am looking for any .NET Framework 2.0 sample for recusrively read a
directory structure and turn it into an XML DOM document and then
recusrively read the document itself.
Thanks. Tag: Change group name witn wmi or adsi Tag: 123313
ClickOnce Deployment and the ConfigurationSection
I have created an application that stores my configuration settings using
the ConfigurationSection, ConfigurationElements, and
ConfigurationElementCollection. Due to the complexity of my configuration
(hence the collection piece) I did not try using the settings API. I have
now gotten to the point where I need to worry about deployment and updates.
ClickOnce deployment works great except for the fact that everytime my
application gets updated, the settings will get lost.
Is there a way to use ConfigurationSection along with ClickOnce and get the
settings transferred on an update? Or do I need to investigate another
method of updating or store my settings in another manner?
TIA
Seth Tag: Change group name witn wmi or adsi Tag: 123303
Suppressing .Net-BroadcastEventWindow issue
Since migrating an application from .Net framework 1.1 to 2.0, I have an
issue where when the app exits, I receive a popup error referring to the
.Net-BroadcastEventWindow having an application error.
Some searching through Google groups indicates that this is probably COM
related. The app does in fact reference a legacy COM object (not ours to
control) and if I don't access it, the error doesn't occur on exit.
Unfortunately, that COM object is rather important, so I can't choose to
not use it.
Ultimately the app seems to work fine and without any errors relating to
the COM object, and as mentioned, none of these issues existed in the
1.1 framework. At this point I'd just like to suppress the error if at
all possible. Finding the cause is a good goal going forward, but I
think this error is more aesthetic than consequential.
Any suggestions? Tag: Change group name witn wmi or adsi Tag: 123299
c# Add to elements of a string array
Hi
I have a file list box with which i am passing the selected items to a
string array (using copyTo), however i also need to pass the path of
the FLB with each string in the array. Is it possible to add this to
each element of the array or is there another approach i could take.
Thanks
Colin Williams Tag: Change group name witn wmi or adsi Tag: 123297
CF2.0SP1 HttpWebRequest.Abort() hangs
the behaviour of
HttpWebRequest.Abort()
is different between CF2.0 and CF2.0SP1
The problem is that the function call does not return in CF2.0SP1 and slows
down the Mobile phone extremly.
What have i to do to abort a http request with CF2.0SP1?
Ralf Tag: Change group name witn wmi or adsi Tag: 123294
Help with creating a search engine in excel vba
I am able to input data, I am able to scroll through a hidden excel
sheet that stores the input data by using the application. I want to be
able to use the input box to search the hidden sheet for the data
without scrolling through every single page. I want the input box to
return the value and the associated content to that value if it exisit
after clicking the search command. Is there anyone out there that knows
a way that this can be done? If so please respond to this Thanks Zig! :) Tag: Change group name witn wmi or adsi Tag: 123286
monitor.tryenter
I am using monitor.tryenter as follows
Do Until Monitor.TryEnter(lockLastBets, 10)
moni += 1
sendMsg("PMB std" &
Thread.CurrentThread.Name & " failed " & moni & " times", timesOther)
Loop
It appears that (occasionally?) the tryEnter doesn't relinquish control to
the other thread which is holding the lock.
I thought the whole point of TryEnter was to give a chance for the other
lock holder to finish his job and release the lock. After n failures TryEnter
returns to caller returning false. The caller can then decide what to do. I
send an error msg and go round the loop again.
Have I got it wrong?
--
--
Victor Tag: Change group name witn wmi or adsi Tag: 123285
Reflection, Enums and their values?
I have an set of enums like the following, that are in a class that I'm
using from elsewhere;
Public Enum Q001resp As Integer
Yes = 1
No = 5
NotAnswered = 0
End Enum
Using Reflection, I am able to look at the properties of that class,
and I'd like to be able to not only get the names of these enums, but
also their possible values.
For instance, I think I can get the Q001resp name (if I recall, I've
done this before, but can't say for sure).
I'd like to be able to get the string of "Yes" and the value of 1, the
string of "no" and the value of 5, and the "NotAnswered" and value of
0.
Is this possible with reflection? Tag: Change group name witn wmi or adsi Tag: 123283
Installationpath Windows Service c#
How can i get the path of the installation folder of my service?
(The service itself should access a file installed in the same
directory.)
Thanks in advance Tag: Change group name witn wmi or adsi Tag: 123282
Weird impersonation issue
Just recently, we started getting a weird impersonation problem on one
of our web apps (which used to work).
IIS is set to use Windows Authentication, Anonymous is disabled
Web.config specifies to use Windows Authentication, Impersonate = true
Web server is trusted for delegation.
The app goes out to a file server (on the local network) to retrieve an
image file.
Here is where it gets weird - If I run the app from my machine, the
authentication and impersonation work and I can get the file to
manipulate it. If I go to the Security Log on the file server, I can
see my User Name and the Success Audit.
However, if I go to any other computer, still using the same domain
account, the Impersonation does not seem to make it all the way to the
file server. I use
System.Security.Principal.WindowsIdentity.GetCurrent().Name to get the
user that the process is running under and it returns my user name,
however, on the file server, there is a failure audit from
WEBSERVER\Anonymous Logon.
I have had another person test it, and they get the same results - it
does not work from their machine, but if they log on to my computer, it
works fine.
Anyone have any idea what is going on here? Why is this only working
from my computer? I thought I looked at all the relevant settings in
IE, etc, but can't find any differences. Any ideas? Tag: Change group name witn wmi or adsi Tag: 123279
WSUS
Hi,
Please, we would like to know some specific information related to the new
Windows Server Update Services 3.0.
We know that there is a method in IUpdateServer, GetPublisher which gets the
IPublisher interface. The GetPublisher method takes a string parameter
sdpfile. We would like to know what data we need to pass to this API to get
an IPublisher interface.
IUpdateServer wsusServer = AdminProxy.GetUpdateServer();
IPublisher publisher = wsusServer.GetPublisher(sdpFile); //
Need information on sdp file, that we need to provide
publisher.PublishPackage (sourcePath, packageDirectoryName); // Need
more information on sourcePath , packageDirectoryName parameters
More over us are looking for more information on the PublishPackage method
of IPublisher interface. Right now the issues that we face are there is not
much documentation around in the MSDN.
Can you please help us by your thoughts and some samples to start with?
Thanks in Advance
--
Anil.S
.NET Developer Tag: Change group name witn wmi or adsi Tag: 123278
need help on using word docs
Hi,
I've a requirement in which I need to show a word document in the web page,
allow the user to edit the document and then save the document ina
particular location, How can I acheive in asp.net 1.1? need guidance.... Tag: Change group name witn wmi or adsi Tag: 123275
need help on using word docs in asp.net
Hi,
I've a requirement in which I need to show a word document in the web page,
allow the user to edit the document and then save the document ina
particular location, How can I acheive in asp.net 1.1? need guidance.... Tag: Change group name witn wmi or adsi Tag: 123274
Overriding Equals method
hi,
I have some questions regarding overriding Equals method so I can use it on
my objects.
1) When overriding Equals method, do I have to check all fields for
"equality" or just the ones I want to use to distinct my objects ? As far as
I know, only the ones I want to use to distinct my object by ... field
"Name" in the example bellow.
2) What does a method GetHashCode() do exactly, and do I have to put all of
my fields in it or just fields I want to use to distinct my objects by ?
Thanx, Neven
---------------------
public class Person {
string _Name = "";
string _Phone = "";
public string Name {
get {return _Name;}
set {_Name = value;}
}
public string Phone {
get {return _Phone;}
set {_Phone = value;}
}
public override bool Equals(Object obj) {
if (obj == null || GetType() != obj.GetType()) return false;
Person person = (Person)obj;
return _Name == person.Name && _Phone == person.Phone;
}
public override int GetHashCode() {
return _Name.GetHashCode() ^ _Phone.GetHashCode();
}
} Tag: Change group name witn wmi or adsi Tag: 123269
How would you do a time estimate of a conversion from VB6 to dot net?
I hate doing estimates of how long things will take, but of course
people want them. I am doing some modifications on a VB6 system and
the owner wants an estimate on how long it will take to convert it to
VB dot net. How would you approach doing a time estimate on this?
I have worked in VB dot net, but I have never converted a system from
VB6 to dot net. Tag: Change group name witn wmi or adsi Tag: 123247
CLR Debugger points to incorrect source code
I have two programs with the same name but different name spaces.
i.e .
BusinessProcess.Provider
and
DataAccess.Provider
What happens when I debug remotely, is that the debugger will point to
the BusinessProcess.Provider instead of the DataAccess.Provider. I can
tell that its really executing DataAccess.Provider because of the line
numbers and the variables change values as if its executing
DataAccess.Provider. But, its still pointing to
BusinessProcess.Provider while debugging.
Anyone know how to make the CLR debugger point to the correct
namespace.program? Tag: Change group name witn wmi or adsi Tag: 123244
Listbox selected items to string array
Hi
I am trying to pass the selected items from a multiselect listbox to a
string array. Can any body give me a start.
Thanks
Colin Williams Tag: Change group name witn wmi or adsi Tag: 123242
comparison reporting -- technique suggestions?
hello,
i have been given a challenging project at my org.
i work on an inventory management web application -- keeping tracking
of parts assigned to projects. in the past, i built an in-house ASP.NET
reporting system. just your standard stuff -- user clicks on a report,
the page executes a pre-defined SQL query, a dataset is formed and
bound to a data repeater. that works well for us. and using some nifty
CSS, my reports look good on screen & on paper.
now, however, my users would like....comparison reports. with
comparison reporting, theyd like the ability to:
a) take a "snapshot" of a given live report, storing it for later
b) compare a given report to one of the previously-stored snapshots
the mechanism for this would ideally show them a screen of three sets
of data:
- new rows (parts added since the referenced snapshot)
- deleted rows (parts that existed in the snapshot, but dont now)
- changed rows (parts that existed in the snapshot, but have at
least one different column)
ideally, theyd like a technique that can be used generically for any of
our current or future reports (but limited, of course, to
same-report-type comparisons).
...some tall order -- this is nothing ive ever attempted before. a few
ideas came to mind for doing this:
1) when a user takes a snapshot, the dataset is serialized into text,
and dumped into a CLOB in the db. when the user later does a
comparison, the desired CLOB is restored into a dataset. then code must
be written to enumerate and evaluate the tables. rows matching one of
the categories must be inserted into new a "results" dataset
(consisting of the 3 tables for new/deleted/changed rows).
2) alternatively, some sort of "history" could be implemented on our
tables on the (Oracle) backend -- like triggers that update new history
tables, that log changes. then some means of comparing present-day data
to the history tables must be devised.
3) investigate a 3rd-party reporting package that offers this ability.
as i mentioned, ive never set about this particular task in my years of
.net web apps. no idea on how it can or should be done.
can anyone point me to references, or suggest possible solutions?
thanks!
matt Tag: Change group name witn wmi or adsi Tag: 123241
filter in DataTable.Select
How do I specify the filter for a column with NULL value in
DataTable.Select(filter, sort) function?
string filter = "columnname=NULL"; ? Tag: Change group name witn wmi or adsi Tag: 123238
Embedded Resource Name Specification
SUMMARY: I want to override the default embedded resource naming
convention and excercise complete control over the name of an embedded
resource within an assembly.
DETAIL: For non-dependent files, visual studio names a resource
according to the convention <default
namespace>.<FolderName>.<FileName>. How can some other name for a given
resource be specified? I am willing to manually modify the project file
if necessary.
Thank You,
Chris Moore Tag: Change group name witn wmi or adsi Tag: 123237
Problem with using AppDomain/Assembly Loading in Queued Component
Hi,
After many searches online and cannot find the right solution for my
issue, I decided to post my question here. If you can help or know
something on this, please give me some hints? Thanks in advance !
ISSUE:
I have a queued component ( COM+ serviced component and written in C#)
that needs to load my .NET assembly dynamically into the AppDomain.
Code goes like this:
AppDomain newAppDomain = new AppDomain ();
newAppDomain.CreateInstanceAndUnwrap("myClassName","myProjectNameSpace.myClass");
*** Note: myClass assembly is C# and I generated tlb for it and loaded
the assembly into GAC and registry (via regasm). ***
When running this queued component, I always got error
"System.IO.FileNotFoundException: File or assembly name myClassName, or
one of its dependencies, was not found." Looks like DLLHOST is looking
into C:\WINDOWS\system32\ for my dll while my dll is actually in
another directory (Note: the dll of queued component and my assembly
are in same bin directory). What needs to be done to avoid this error ?
Some error log:
System.IO.FileNotFoundException: File or assembly name myClassName, or
one of its dependencies, was not found.
File name: "myClassName"
Server stack trace:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark&
stackMark)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String
typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder,
Object[] args, CultureInfo culture, Object[] activationAttributes,
Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String
typeName)
at System.AppDomain.CreateInstance(String assemblyName, String
typeName)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName,
String typeName)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage
msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName,
String typeName)
at myClassName.MyMethod..ctor()
=== Pre-bind state information ===
LOG: DisplayName = myClassName
(Partial)
LOG: Appbase = C:\WINDOWS\system32\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: Application configuration file does not exist.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: myClassName
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/myClassNameDLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/xhparser/myClassName.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/myClassName.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/system32/xhparser/myClassName.EXE.
============== END ======================= Tag: Change group name witn wmi or adsi Tag: 123235
Upgrading from .NET Framwork 1.1 to 2.0
Hi,
We have an app that have been compiled to use .NET Framework 2.0. It runs
fine from the server but from the workstation it generates an error message
something like "This program could not start because the program
configuration is wrong. If you reinstall the program it can solve the
problem". I suppose it is .NET Framework that generates this message. In .NET
Framework 1.1 we used to set access to full trust for the local intranet. I
can not see such an configuration option for .NET Framework 2.0. Any idea
what is the problem? Tag: Change group name witn wmi or adsi Tag: 123228
Duplicate Accelerator keys
Hi,
Ok here is the scenario.
I have an application with a lot of forms and some of them have a lot
of controls on them.
Inevitably duplication of accelarator keys has happened.
The duplication is only between the form level controls and the menus.
so I would like suggestions to work around this problem.
-can I provide multiple keys as accelrator keys (like E&x&it so that
pressing alt+x+i will enable this menu) Tag: Change group name witn wmi or adsi Tag: 123225
Dupicate accelerator keys ..
Hi,
Ok here is the scenario.
I have an application with a lot of forms and some of them have a lot
of controls on them.
Inevitably duplication of accelarator keys has happened.
The duplication is only between the form level controls and the menus.
so I would like suggestions to work around this problem.
-can I provide multiple keys as accelrator keys (like E&x&it so that
pressing alt+x+i will enable this menu) Tag: Change group name witn wmi or adsi Tag: 123224
Missing referenced assemblies in compiled dll ...
Hi,
I have a project that references a couple of other dll:s. After I compile
the project I use IL DASM to have a look on the Manifest of the compiled
dll. The thing is that not all referenced dll:s are in there (I'm missing 3
of 7)!
My problem is that I need to find all referenced assemblies by reflection
(using GetReferencedAssemblies) ...
Is there a explination to this? I could really need some help and ideas with
this ...
Richard Tag: Change group name witn wmi or adsi Tag: 123218
WSE910 and 'Root element is missing.'
I am having trouble with WSE3 and domain authentication\authorisation for a
web service.
When using a the 'NETWORK SERVICE' account for the application pool in IIS
6.0 the web service work perfectly correctly, we are able to call the web
service end point and we can authenticate through our custom WSE
authentication token manager, but when we switch over to a domain service
account we have created to run the application pool we get the following
error:
'WSE910: An error happened during the processing of a response message, and
you can find the error in the inner exception. You can also find the
response message in the Response property.'
The inner exception states:
'Root element is missing.'
The domain account is a member of the IIS work process group on the local
box, it as the required security permissions for the directory where the web
service is installed.
What is very strange is that when this service account was made a domain
admin temporarily the call worked perfectly fine.
So the question is what permissions does WSE3 require so that we can get our
domain service account to work correctly.
Cheers in advanced
Ollie Riches Tag: Change group name witn wmi or adsi Tag: 123215
css failure on postback
Hello all,
I develop aspx pages for internal use. We use IIS 6, .net 2 and IE 6.
In the head of the clientcode I call a css file like "@import
url(../CSS/Styles.css);"
All this runs fine. When I pubish the site to the server and call it
from a clientmachine everything looks fine as well. But when there is a
postback all styles are gone and the site is nearby unuseable. On the
next postback it mostly looks fine again.
Do I use the wrong way to implement the css or do I have to update the
.net Framework with something?
Thanks for help. Tag: Change group name witn wmi or adsi Tag: 123210
C# to C++ port
Hi everyone,
We have a dll component developed in C# and used by the other projects (exe)
written in C#.
This component has been tested and proved to be very robust component and so
we are going to re-use it in another application (very large code base)
which has been already written in unmanaged C++.
What is the best strategy between the following two options:
1. Write a managed C++ wrapper around the C# component and use that wrapper
in our unmanaged C++ project.
2. Port the C# component completely to an unmanaged C++ component and then
use it in our unmanaged C++ project.
The main advantage of option 1 is that it seems much quicker and we can also
benefit from .Net framework library without having to re invent the wheel or
use other 3rd party libraries.
The main advantage of option 2 is that we are not going to get involved in
the potential problems involved in mixing managed and unmanaged codes.
Does anyone have any other ideas (maybe option 3 ...) or see another pros
and cons in going with either option 1 or option 2?
Any help would be appreciated
Luca. Tag: Change group name witn wmi or adsi Tag: 123206
excel
hi,
i did not the office version of the system in which the application is
going to be deployed.
is there any way of opening an excel file which is office independent.
My requirement is that i have to open a template file which is in the
server.
regards,
kalaivanan Tag: Change group name witn wmi or adsi Tag: 123203
XMLSerialization of complex content
I would like to serialize some XML where one of the elements contains html
content:
<MyXML><DataContent><p><b>ABC News Online</b></p></DataContent><MyXML>
However the XMLSerializer gives me the following exception:
System.Xml.XmlException: Unexpected node type Element. ReadElementString
method can only be called on elements with simple or empty content
I would like the serializer to read out all the HTML content from the
<DataContent> element.
My class looks like:
using System.Xml.Serialization;
namespace ABC.MyXML_5.BL
{
[XmlRoot("MyXML")]
public class MyXML_5
{
private string element_datacontent;
[XmlElement]
public string DataContent
{
get { return element_datacontent; }
set { element_datacontent = value; }
}
}
}
My code looks like:
//10.Create some XML
StringBuilder l_strBldrXML = new StringBuilder();
l_strBldrXML.Append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
l_strBldrXML.Append("<MyXML>");
l_strBldrXML.Append("<DataContent>");
l_strBldrXML.Append("<p><b>ABC News Online</b></p>");
l_strBldrXML.Append("</DataContent>");
l_strBldrXML.Append("</MyXML>");
//20.Put XML into an in memory stream
Stream l_StreamTest =
new
MemoryStream(Encoding.GetEncoding("Windows-1252").GetBytes(l_strBldrXML.ToString()));
//30.Deserialize into instance of a class
XmlSerializer l_Serializer = new
XmlSerializer(typeof(ABC.MyXML_5.BL.MyXML_5));
ABC.MyXML_5.BL.MyXML_5 l_MyXMLDocument;
l_MyXMLDocument =
(ABC.MyXML_5.BL.MyXML_5)l_Serializer.Deserialize(l_StreamTest);
l_StreamTest.Close();
Assert.IsTrue(l_MyXMLDocument.DataContent == "<p>ABC News Online</p>"); Tag: Change group name witn wmi or adsi Tag: 123201
calendar control
I have a calendar control that has runs a longish bit of code in the
ValueChanged event.
How do I get the control to repaint before running the code.
At the moment the calendar month view stays active while the code is
running.
Thanks in advance
VS 2005 / C# / CF2 Tag: Change group name witn wmi or adsi Tag: 123195
TcpClient.Connect causes three first chance exceptions
Hi all, I've got a client/server application and just wanted to ensure
that this is expected behavior. I recently set the following
configuration in Visual Studio:
Debug->Exceptions->Break Into Debugger
for the CLR Exceptions
And when my debugger hits the TcpClient.Connect statement and the
server is not available - I get the following three first chance
exceptions:
A first chance exception of type 'System.Net.Sockets.SocketException'
occurred in system.dll
Additional information: The requested name is valid and was found in
the database, but it does not have the correct associated data being
resolved for
----------------
A first chance exception of type 'System.Net.Sockets.SocketException'
occurred in system.dll
Additional information: A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond
----------------
A first chance exception of type 'System.Net.Sockets.SocketException'
occurred in system.dll
Additional information: A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond
----------------
I handle the exception and my code continues on its merry way - I just
wanted to see if anyone could provide some insight on this.
Thanks,
Novice Tag: Change group name witn wmi or adsi Tag: 123188
"Start external program" no longer works in VS2003 once 2.0 framework installed
I am developing a component in .Net 1.1, and want to debug it using the
"start external program" of the debugger in the IDE. The program I want
to start references both 1.1 and 2.0 components. The problem is that
when I launch this from VS2003, the external program starts only for a
moment and then bails out of memory
with no error, and the ide returns to a stopped state awaiting my
input. If I remove the 2.0 framework, at least the external app will
start up and stay in memory, but I will get the error (as expected)
that some pieces could not be found (i.e. pieces of the 2.0 framework).
Should not VS2003 (which is based on framework 1.1) be able to run
under 2.0 as they are backward compatible???
Thanks for your help,
Marcus Tag: Change group name witn wmi or adsi Tag: 123184
BadImageFormatException
Hi
I have received an error message from a user of my software, which is an
Add-In for Visual Studio 2005. The user is using a French version of Visual
Studio.
A BadImageFormatException occurs, and it appears that the FileName property
in the BadImageFormatException structure is an empty string.
The stack trace is as follows:
à System.ModuleHandle._GetPEKind(Int32& peKind, Int32& machine)
à System.ModuleHandle.GetPEKind(PortableExecutableKinds& peKind,
ImageFileMachine& machine)
à System.Reflection.Module.GetPEKind(PortableExecutableKinds& peKind,
ImageFileMachine& machine)
à System.Reflection.Assembly.ComputeProcArchIndex()
à System.Reflection.Assembly.GetName(Boolean copiedName)
à System.Reflection.Assembly.GetName()
à
System.ComponentModel.Design.RuntimeLicenseContext.CaseInsensitiveManifestResourceStreamLookup(Assembly
satellite, String name)
à
System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type
type, Assembly resourceAssembly)
à
System.ComponentModel.LicenseManager.LicenseInteropHelper.GetCurrentContextInfo(Int32&
fDesignTime, IntPtr& bstrKey, RuntimeTypeHandle rth)
à MultiLang.modGlobalDbUtil.OpenGlobalDatabaseConnection()
à MultiLang.ctlToolWindow.InitAddInWindow(DTE newVal)
à MultiLang.Connect.OnConnection(Object application, ext_ConnectMode
connectMode, Object addInInst, Array& custom)
The last function in my software is
MultiLang.modGlobalDbUtil.OpenGlobalDatabaseConnection
which opens an ADO database connection to an mdb (access 2000) database
file.
This is ADO and not ADO.NET.
I have simply no idea why execution is entering LicenseManager code. I have
tried putting a breakpoint in this module (via the disassembly window) but
as far as I can tell it is not entered on my system.
I am totally baffled by this error and would appreciate any help.
Thanks in advance,
Phil Tag: Change group name witn wmi or adsi Tag: 123180
System.Timers.Timer stops firing event
I have a Windows Service with a Timer object with an interval of 500 ms, in
each event the windows service starts a new thread, up to a limited number of
threads, and does some work.
It works fine as to the users requirements, but sometimes freezes. The
Service is running, its process is visible on Task Manager as usually, no
events on the Event Log are related to the service, but the work is not done.
After some tests I foun out that the the code associated with the OnTimer
Event stops being executed with no apparent reason.
I'm clueless.... :(
Some code:
public class QueueHandler : System.ServiceProcess.ServiceBase
{
private System.ComponentModel.Container components = null;
private System.Timers.Timer timer = new System.Timers.Timer();
private Thread[] serviceThreads;
protected override void OnStart(string[] args)
{
serviceThreads = new Thread[25];
int interval = 500;
string autoThreads = "no";
timer.Elapsed += new ElapsedEventHandler(OnTimer);
timer.Interval = interval;
timer.Enabled = true;
}
protected void OnTimer(Object Source,ElapsedEventArgs e)
{
int x = GetNextFreeThread();
if (x >= 0)
serviceThreads[x].Start();
}
private int GetNextFreeThread()
{
int threadID = -1;
MessageProcessor mProcessor = new MessageProcessor();
ThreadStart tStart = new ThreadStart(mProcessor.ProcessMessage);
for (int y = 0;y<serviceThreads.Length;y++)
{
//if thread slot is free instaciate new thread
if(serviceThreads[y] == null || serviceThreads[y].ThreadState ==
System.Threading.ThreadState.Stopped)
{
threadID = y;
serviceThreads[threadID] = new Thread(tStart);
serviceThreads[threadID].Name = "QueueThread_" + y.ToString();
serviceThreads[threadID].IsBackground = true;
serviceThreads[threadID].Priority = ThreadPriority.Lowest;
break;
}
}
return threadID;
} Tag: Change group name witn wmi or adsi Tag: 123171
Programming a "Send to" app
If I put a shortcut to an app in the Send To folder, then I can select one
or more files in Windows Explorer, right-click on the files, select Send
to -> MyApp, and my application will run with the selected file paths
supplied as a command line argument. The problem with this is that the
command line has a limited length. I can only select 15 or so files to send
to my app without truncating the command line.
I've noticed that many of the "built in" items in the Send To folder accept
an (apparently) unlimited number of selected files. What is the mechanism
that they use to get the selected file list, and can I write a .Net app that
does the same thing?
TIA - Bob Tag: Change group name witn wmi or adsi Tag: 123167
Forms Auth fails after moving to another machine
The app is running fine on my development machine at work as well as
on our test deployment server. It's using the standard ASPNETDB.MDF in
the app_data folder and sqlexpress is up and running. I can attach the
file and look at the tables.
The login1.loggedIn event fires, so the authentication appears to be
working. But instead of going to the correct page, it just shows the
logon page again. Any idea about why it's failing is welcome. Tag: Change group name witn wmi or adsi Tag: 123157
acquiring standard out, standard error
Hi,
I have managed to acquire the standard out & error streams of an app by
starting it with System.Diagnostics.Process. Works great.
How do I acquire the standard output & error & in streams of an already
running application, for instance, a service. Basically I need to monitor the
standard out & error streams of a running app from another app.
Thanks
Paul Tag: Change group name witn wmi or adsi Tag: 123156
Target the Framework version from 2.0 to 1.1
Dear all,
I have encountered a problem of "DragDrop registration failed"
problem in my .NET 1.1 dll because of the assembly binding is always
going to .NET 2.0. Therefore I tried to specifiy the runtime version
and redirect those bindings in MyModule.dll.config.
The binded assemblies, however, are still in .NET 2.0, according to
both VS.NET 2003's output log and VS.NET 2005's fuslogvw. Meanwhile,
they also logged compiling and linking processes. At that stage, linked
assemblies are in version 1.1 correctly.
My question is, does it means that configurations of runtime version
and assembly binding redirection do not work backward from 2.0 to 1.1?
Thank you for your precious time.
Best Regards,
Mike Tag: Change group name witn wmi or adsi Tag: 123143
Using webproxy.
Hi all,
I want to send webrequest using webproxy so that i can hide my Pc's ip
address from server.
So i decided to use proxy and set that proxy details to webrquest using
webproxy.
My question is if i am using proxy for sending request what details of
proxy server will get send to webserver?. what if that proxy server's
access is block by webserver. But through my pc webrequest is
accessiable. In that case what should i do?
If i am wrong in concept please correct me.
thanks in advnace. Tag: Change group name witn wmi or adsi Tag: 123139
Problem with transprancy and opacity
When I give my form a white background, make the transparency key white, and
have the opacity set to 100% (1) everything works fine.
However, if I change the opacity to 50% (.5) the rather then have a form
that is transparent where the white is I get a foggy white.
Is there a fix for this, I want the form to be 50% opacity and the
transparency to remain fully transparent.
Thanks, Rob Tag: Change group name witn wmi or adsi Tag: 123135
vb.net not responding
Thanks in advance for any help. I have a Windows form I have written in
vb.net (2003 - Standard Ed.). It reads an xml file, populates a
datagrid and updates back to the xml file when changes are mde on the
datagrid such as additions or record modifications. I go to build with
F5 and the hourglass pops up and doesn't go away even though the
Windows Task Manager doesn't show "Not Responding". The build is listed
as 1 Successful buildwith no erros. Any ideas on this one?
Here is my code:
Imports System.Data
Imports System.Xml
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Dim xdd As XmlDataDocument
Dim ds As DataSet
Private Sub btnLoadXml_Click(ByVal sender As System.Object, ByVal e
As _
System.EventArgs) Handles btnLoadXml.Click
Dim xtr As XmlTextReader = _
New XmlTextReader("C:\Documents and
Settings\Cheryl&Brian\Desktop\XMLforProject.xml")
xdd = New XmlDataDocument
ds = xdd.DataSet()
ds.ReadXmlSchema(xtr)
xtr.Close()
xtr = New XmlTextReader("C:\Documents and
Settings\Cheryl&Brian\Desktop\Books.xml")
xtr.WhitespaceHandling = WhitespaceHandling.None
xdd.Load(xtr)
dgXML.DataSource = ds
dgXML.DataMember = "Book"
xtr.Close()
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
_
System.EventArgs) Handles btnSave.Click
Dim xtw As XmlTextWriter = New XmlTextWriter("C:\Documents and
Settings\Cheryl&Brian\Desktop\XMLforProject.xml",
System.Text.Encoding.UTF8)
xtw.Formatting = Formatting.Indented
xdd.WriteTo(xtw)
xtw.Close()
MessageBox.Show("The XML file has been successfully updated !")
End Sub
End Class Tag: Change group name witn wmi or adsi Tag: 123130
Hi all,
I have questation about change group name in the Active directory . I am try
use the win32_group , but this change only win2000 name .
Thanx
Marek