System.Diagnostics.Process.Start fails on windows server 2003
System.Diagnostics.Process.Start fails on windows server 2003
the process returns process.ExitCode == 0 but executing any process with
System.Diagnostics.Process.Start on windows xp works fine.
anything to do different for windows server 2003? some special permission
for the process that executes another executable with
System.Diagnostics.Process.Start ??
here is the code:
System.Diagnostics.Process process =
System.Diagnostics.Process.Start(info); // could be any executable file even
notepad.exe
process.WaitForExit();
if(process.ExitCode != 0)
{
throw new Exception("unable to execute");
} Tag: Clipboard.GetData is always returning null Tag: 114927
POS System
I would like to create a Point Of Sale System. Is there a website that sells
the interface between a POS Cash register and .NET?
Thanks for the help Tag: Clipboard.GetData is always returning null Tag: 114925
non blocking socket exception
When using .net remoting over tcp what could cause the non blocking socket
exception error. I receive the error at diffrent times.
Ricky Tag: Clipboard.GetData is always returning null Tag: 114923
Generate .NET types from C header file?
Hi all,
The question of reusing C header files in C# comes up frequently and there's
really no general solution. I do have a specific problem that I think can be
solved and I'd like to get some feedback on.
I have a C# app that communicates with an embedded C app via UDP packets. I
have to ensure that both sides see the exact same data structure. I know how
to do this by defining classes with attributes in C# and defining the
appropriate header and compiler switches on the embedded system.
I'm wondering if I can have a single source that defines the structure for
both systems. Right now I can envision the following solutions:
1) Write a utility that parses the C header and generates the C# class
definition.
2) Write a utility that parses some other file format (XML, etc.) and
generates both the header and the C# class definition
3) Use C++/CLI to somehow generate a .NET type that gets imported into the
C# app.
Solutions 1) and 2) are doable but seem kind of tedious and boring. Anyone
know if tools like this exist? The C headers have not been written yet and
they will be quite simple. No need to parse exotic C constructs.
Solution 3) seems a little more interesting but is it doable?
Thanks for any comments,
Andrew Queisser Tag: Clipboard.GetData is always returning null Tag: 114920
2.0: Nested configuration data
Hi,
I'm trying to specify multiple child collection under a ConfigurationSection.
I have
<asystems name="pippo">
<asystem newName="Production"/>
<asystem newName="dev"/>
<anotherItem newName="yuk"/>
<anotherItem newName="yuk111"/>
</asystems>
It seems that only one colleciton colud be specified,
[ConfigurationProperty("", IsDefaultCollection = true)]
public SystemsCollection Systems
{
get
{
return (SystemsCollection)base[""];
}
}
To retrive the simpler config
<asystems name="pippo">
<asystem newName="Production"/>
<asystem newName="dev"/>
</asystems>
with a given name like
[ConfigurationProperty("asystem", IsDefaultCollection = false)]
public SystemsCollection Systems
{
get
{
return (SystemsCollection)base["asystem"];
}
}
did not work.
Any idea?
--
Carlo Folini Tag: Clipboard.GetData is always returning null Tag: 114919
.NET 1.1 created event log has only "Not available" properties
We are using VB.NET 2003 Diagnostics.EventLog class on Windows 2000 to create
our own custom event log. When using Computer Management and doing
properties on the event log it only displays "Not available" for the Size,
Created, Modified, and Accessed attributes. The event log is working just
not the display of the attributes mentioned above.
Does anybody know how to resolve this?
--
Thanks,
Tim Tag: Clipboard.GetData is always returning null Tag: 114917
resource leak issues in win xp sp2 w .net 2.0
Hi,
we are running XP SP2 with .net 2.0 framework installed we also installed a
.net application that we wrote and run it occasionally without problem.
however at some point (even with our application not running) but quite a few
other windows open our workstations seem to run out of resources. as in. we
cannot open any more windows (be it explorer windows, IE windows or any
program for that matter). or sometimes the window will "half" open (the
window will come up but say the IE tool button will be missing). now if we
close an existing window (IE, explorer window , calc and program) we can then
open another program (like a 1:1) correlation.
the other thing i noticed when i was in this state and i say tried to run a
ping using cygwin i got win32 error 1114 user32 could not be loaded.
we have seen this on 4 machines now.
any ideas?
Cheers
Tony Tag: Clipboard.GetData is always returning null Tag: 114914
no touch request adds .config to url
I have a "no touch" deployment app running successfully on XP. All
machines use the 1.1 framework.
When a url specifying an exe file is entered on an XP machine, the exe
is downloaded by the framework (asp.net on the web server machine) and
the exe runs on the "client" machine. The first thing it does is
download an xml file. This works OK on the XP client.
When the same url is entered on a WIN 2000 machine the exe is
downloaded but whe it attempts to download the xml file a
ConfigurationException is thrown. The client is trying to download a
.config file. The .config is tacked on to the end of the url (no
matter how many parameters are on the url) and the request fails. BTW,
there is no config file associated with the executable.
Why is WIN 2000 different than XP in this case? How can I prevent, or
catch, this error? Thx Tag: Clipboard.GetData is always returning null Tag: 114913
database connection loss
Hallo!
I'm working with C# .NET 2.0, implementing Client/Server Applications which
are connecting via Network to SQL-Server or Oracle Databases.
To stay independent from the underlaying Database I use
System.Data.Common.DBConnection and .DBCommand.
How can I keep aware from connection losses (network not availeable,
db-server not available...)?
Are there any strategies to detect this broken connections, and how can I
implement reconnecting to the database?
The only solution I figured out, is creating a thread which frequntly
performs a SELECT 1 (MSSQL) or SELECT 1 FROM DUAL (Oracle) within a
try-catch block. When an exception occurs I have to send my other
worker-threads to sleep, till I'm able to reopen the database connection and
my Select-Statement works again. Then I have to trigger the other threads to
reopen their connections and continue working (every thread gots his own
DBConnection).
For me this seems a little bit to complicated and insecure.
It also could happen that one of the worker threads gots a timeout due
locking or delayed server responstime, and will loose his Connection in fact
of this exception. Such, or similar problems I can not get handled with my
solution.
Are there any suggestions, patterns or automathisms with ADO 2.0?
with friendly regards
Martin Tag: Clipboard.GetData is always returning null Tag: 114912
Recreating an event source in a new event log
Hi,
I recreating an event message source inside a new log but the messages keeps
ending up in the old log?! I have simplified my code into this tiny snippet:
EventLog.CreateEventSource("mySrc", "myLog1");
EventLog eventLog = new EventLog();
eventLog.Source = "mySrc";
eventLog.WriteEntry("MyEntry1");
eventLog = null;
if (EventLog.SourceExists("mySrc"))
{
EventLog.DeleteEventSource("mySrc");
EventLog.CreateEventSource("mySrc", "myLog2");
}
eventLog = new EventLog();
eventLog.Source = "mySrc";
eventLog.WriteEntry("MyEntry2");
eventLog = null;
The problem is that both "MyEntry1" and "MyEntry2" is written to "myLog1". I
had expected that "MyEntry2" would end up in "myLog2"? What's wrong with this
code?
regards,
martin Tag: Clipboard.GetData is always returning null Tag: 114904
HashTable stores whole object as Key NOT the result of calling GetHashCode on the object when you do myHashTable.Add?
Hi All
I was testing my understanding of Hashtables and I thought that if I
override GetHashCode then i could add an object to hashTable like so:
Dim ht As New Hashtable
ht.Add(s1, s1)
ht.Add(s2, s2)
ht.Add(s3, s3)
Where s* are instance of a student class that overrides GetHashCode to
return the StudentID (code at end of post).
I shouldn't add it like:
ht.Add(s1.GetHashCode(), s1)
as the HashTable calls GetHashCode on the Key for me.
This should then store the Hash (The ID returned from GHC) as the Key and
the student as the object. However if you loop through the HashTable with:
Dim de As DictionaryEntry
For Each de In ht
Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value)
Next
It shows that the student is stored as both the Key and the Value. Does this
mean that you should just add objects to the HashTable like:
Dim ht As New Hashtable
ht.Add(s1, Nothing)
ht.Add(s2, Nothing)
ht.Add(s3, Nothing)
Seems to me I have misunderstood something here and thw whole point of a
HashTable is to use a key to get to a value, was hoping somebody could clear
this up for me.
Cheers
John
Student Code
Class Student
Private _Name As String
Private _ID As Integer
Private _Age As Integer
Public Sub New(ByVal Name As String, ByVal ID As Integer, ByVal age As
Integer)
_Name = Name
_ID = ID
_Age = age
End Sub
Public Overrides Function ToString() As String
Return String.Format("{0} is {1} years old and is student no: {2}",
_Name, _Age, _ID)
End Function
Public Overrides Function GetHashCode() As Integer
Return _ID
End Function
End Class Tag: Clipboard.GetData is always returning null Tag: 114903
ExtractAssociatedIcon with UNC path
Hi,
is there any possibility to call the ExtractAssociatedIcon function
using a UNC path? I'm quite confused at the moment, since
#1) it seems like some .Net functions do not support UNC path
information
#2) mapping a share to a drive during runtime is lame and should only
be used for "DOS" compatibility etc.
Thanks
Michael Tag: Clipboard.GetData is always returning null Tag: 114901
opening VS2005 projects with VS 2003 ?????
hi everybody,
i am new at VS (studying c#) and i eonder that how can i open and
COPiLE VS2005 projects withs VS 2003 (on a computer that have not
NETFRAMEWORK 2.X only have 1.1)
maybe some assembly works but i really woder this..
in my school computers dont have netframework2.x only 1.1. and VS2003
so my projects (created by VS2005) cant be opened in my schools
computers..????
:(
maybe you say :MSBuild Toolkit bla bla ..
thanks for now.
[sorry for my bad english-- you are not babysitter so you have not to
answer this topic :) ] Tag: Clipboard.GetData is always returning null Tag: 114897
menus
Hi all,
I am creating an application that has menu options, with a 'Navigation' menu
that will re-direct the user to the appropriate form when clicked. I have a
Case structure in a class file for the application to access because there
are about 12 different forms to choose from. When the appropriate selection
is clicked, it will call a method in the aforementioned class file, and pass
a global variable to the method. Is the menu index based? I tried to start
the Case at:
Case = 0
show form a
Case = 1
show form b
etc.
This doesn't work. Any suggestions are appreciated.
Thanks! Tag: Clipboard.GetData is always returning null Tag: 114888
BeginInvoke on MulticaseDelegate and params keyword...
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C65E1E.09316620
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Hello,
If I use params keyword in my multicast delegate, can I call it using =
BeginInvoke? BeginInvoke takes some parameters after params keyword. I'm =
confused how to pass them after params...
Thanks!
Zhenxin Li
------=_NextPart_000_0006_01C65E1E.09316620
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DTahoma color=3D#000080>Hello,</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080>If I use params keyword in my =
multicast=20
delegate, can I call it using BeginInvoke? BeginInvoke takes some =
parameters=20
after params keyword. I'm confused how to pass them after =
params...</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080>Thanks!</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080>Zhenxin =
Li</FONT></DIV></BODY></HTML>
------=_NextPart_000_0006_01C65E1E.09316620-- Tag: Clipboard.GetData is always returning null Tag: 114885
Selecting from multiple .NET versions
Hi,
On my PC I have multiple .NET frameworks selected (1.0, 1.1 and 2.0)
In Visual Studio 2003, how do I select which one I use to build my project?
Thanks Tag: Clipboard.GetData is always returning null Tag: 114884
SmtpClient uses lowercase headers and an odd date format when sending a MailMessage
When you send mail using an SmtpClient object
(System.Net.Mail.SmtpClient), the headers it adds like "from:", "to:"
and "date:" are in lower case. This seems to be a red flag to some spam
filters, so it would be good to be able to specify that they be
proper-cased, i.e., "From:", "To:" and "Date:".
Also the date format used doesn't include the weekday, e.g., "31 Mar
2006 07:25:10 +1200" instead of the more common "Fri, 31 Mar 2006
07:25:10 +1200" which is also a red flag to some spam filters, and so
it would be good if it used the latter. Tag: Clipboard.GetData is always returning null Tag: 114883
Relationship between VS.NET 2005 w/ .NET Framework 2.0 & Smart Cli
Hi - Besides ClickOnce, what are the other relationships between VS.NET 2005
w/ .NET Framework 2.0 and Smart Client applications? Does VS.NET 2005 w/ 2.0
framework have other Smart Client development features?
thanks, Tag: Clipboard.GetData is always returning null Tag: 114879
Query VMI with limited right users
Our application written in VB2005 uses a VMI query to gather some information
about the comuter. The method work well when we run the application with a
user having administration right. However, when we run the application with a
user not having adminstration right (standart user) the following execption
is throw.
System.Management.Managementexception: Initialization failure
at
System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
errorcode)
at
System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
Does someone have a idea how to make it works?
Here is the code:
Dim l_uin as string
Dim query As New SelectQuery("Win32_WindowsProductActivation")
' Instantiate an object searcher with this query
Dim searcher As New ManagementObjectSearcher(query)
' Call Get() to retrieve the collection of objects and loop through it
For Each envVar As ManagementObject In searcher.Options.Get()
l_uin = CStr(envVar("ProductID"))
Next envVar
Regards, Tag: Clipboard.GetData is always returning null Tag: 114874
sending mails bounced to address different from sender address
hi all
i have a very specific question regarding emails sending and googling
doesn't help me
is a way exists to send email using .NET framework (System.Web.Mail or
something else)
and have the "from" address to be X
but if the message is bounced from not existing address or whatever, it
will be returned to adress Y ?
i tried to work by approach described in that article :
http://www.codeproject.com/useritems/clean_your_address_list.asp
it looks streigforard, but author is using easymail object
with System.Web.Mail i did not find any way to set OptionFlags to
prevent auto-creation of reverse-path
so , my code looks exactly like described in the article, but without
OptionFlag
and when i send mail to unavailable address, i got bounce to email
specified in "FROM" header
my code example if it can help :
<pre>
MailMessage oMsg = new MailMessage();
// bounced emails goes to email specified in oMsg.From
// sender name displayed for recipient is
oMsg.Headers["From"]oMsg.Headers.Add("Reply-To", oMsgDetails.ReplyTo);
oMsg.Headers.Add("From", oMsgDetails.Sender); oMsg.From =
txtBounceTo.Text ; //reverse-path
oMsg.Subject = oMsgDetails.Subject;
oMsg.BodyFormat = MailFormat.Html;
oMsg.Priority = MailPriority.Normal;
oMsg.To = emailAddress;
oMsg.Body = oMsgDetails.Content;
SmtpMail.SmtpServer = mailServer;
SmtpMail.Send(oMsg);
</pre>
appreciate any help
Thanks Tag: Clipboard.GetData is always returning null Tag: 114873
GAC and development
So we've determined that our assemblies will be getting placed in the GAC
going forward. I have done a bit of research and determined a process based
on that research on how to manage the assemblies for deployment.
Here is my issue, all of the information I find talks about what you should
do for deployment to prod, I've not found very much on how to handle this
with a team of developers.
Where do we put the assemblies?
How do we get each of the dev boxes updated on a daily basis?
How do each of the projects get updated to reference the current build of
the assembly?
How do we deploy current builds, but not screw up anything that may be a
work in progress on the developers box? E.G. they are responsible for fixes
a bug in a shared assembly.
Anyone currently using the GAC that would like to share how they accomplish
this?
Thanks
Wayne Tag: Clipboard.GetData is always returning null Tag: 114867
TimeZone.ToLocalTime changed in 2.0?
We have code that used an instance of a timezone (for a timezone other than
local), and called ToLocalTime(), passing in a UTC time. In version 1.1, the
return value was the time in this time zone.
I have found that in 2.0, the return value is the local time for the
machine. We could do that already with DateTime's ToLocalTime() method. I
have found no combination of values for the new DateTime.Kind flag that gets
me back to what worked in 1.1.
Why was this changed? Was this a bug in 1.1 that was fixed, or is this a new
bug in 2.0? Is there a way to do this with DateTime.Kind? Tag: Clipboard.GetData is always returning null Tag: 114866
Datagrid Issue - Limit to numeric input?
I have a windows form that contains two datagrids (framework 2.0/).
I would like to limit two of the columns to numeric entries only. IE
If the user types a letter or anything other than 0123456789. then I
want to supress the key.
I have tried turning on keypreview on the form (I'm using this method
to limit entries in other textboxes/controls) but this method does not
capture the keys once the datagrid goes into "edit mode".
Ideas on how to do this would be great.
BTW: When you set the format option of the datgrid column to format for
numeric, it still allows the end user to type alpha characters (a-z).
Thanks
Rick Tag: Clipboard.GetData is always returning null Tag: 114865
about bi-directionnal remoting
Hello,
Using .Net Remoting, I need to have several clients which use a object on a
server. This server should call method on those clients.
It's looking like a bi-directionnal communication.
But with .Net Remoting I've only found that schema that is not really nice :
C1 Activator.GetObject( Server.Object )
C2 Activator.GetObject( Server.Object )
C3 Activator.GetObject( Server.Object )
Server Activator.GetObject( C1.Object )
Server Activator.GetObject( C2.Object )
Server Activator.GetObject( C3.Object )
Is there a good practice to do bi-directionnal communication with .Net Remoting.
I could not find anything on msdn2.microsoft.com, perhaps it is because I don't
know the right way ...
Have you got idea ?
Thanks
Cyrille Tag: Clipboard.GetData is always returning null Tag: 114859
Windows Service .NET 2.0 MissingManifestResourceException
I have a simple windows service that was created in vs2005, it uses the
FileSystemWatcher class to watch for directory changes, and if an error
occurs it logs it to the event log. I have used the new Resources
designer to define a few common errors I would like to write to the
event log.
Other than my machine, all clients that are testing are getting the
MissingManifestResourceException that is being written to the eventlog,
System.Resources.MissingManifestResourceException: Could not
find...Make sure"SOXFileSysProperties.Resources.resources" was
correctly embedded or linked into assembly "SOXFileSysWatcher" at
compile time, or that all the satellite assemblies required are
loadable and fully signed. etc.....
I have signed my app, ran against FXCop to ensure all requirements are
being used.
I have a few lines in try/catch that will write as follows
catch(MissingMemberException mme)
{
eventLog1.WriteEntry(string.Format(CultureInfo.CurrentCulture,
"{0}{1}{2}", mme.ToString(), Environment.NewLine,
SOXFileSysWatcher.Properties.Resources.HelpString),
EventLogEntryType.Error);
}
BTW any good reference sites for Windows Service writing, seen
Windowsforms.net, asp.net, etc... but can't seem to find anything
dedicated to windows services, i.e. WindowsServices.net
Thanks for your help Tag: Clipboard.GetData is always returning null Tag: 114857
Reminder: Public NetCF chat today
Just a reminder that MVPs will be hosting an online chat this morning
concerning
Smart Device Programming with Visual Studio .NET. We will be on hand
ready to answer your questions, so bring 'em on!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: MVP chat: .NET Compact Framework and Smart Device Programming
Chat Date: April 11th
10:00am - 11:00am Pacific Time
Additional Time Zones:
http://www.timeanddate.com/worldclock/fixedtime.html?year=2006&month=4&day=11&hour=10&min=0&sec=0&p1=234
Description: You know them from the newsgroups! You love them for their deep
technical answers and charming wit! Please join these amazing Microsoft MVPs
in this live chat regarding the .NET Compact Framework and the Smart Device
Programming features of VS.NET. Please feel free to bring along your Smart
Device Framework questions as OpenNETCF.org will be well represented in this
chat.
To join this chat, please log on via the main MSDN chat page at:
http://msdn.microsoft.com/chats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--
--
Thanks!
Michael Fosmire
MVP Lead, Windows Embedded/.NET Compact Framework
This posting is provided AS IS with no warranties, and confers no rights. Tag: Clipboard.GetData is always returning null Tag: 114856
win32 in memory drawing
Does anyone have a sample code for this? I want to draw an image in memory
into another image using C# and win32 gdi.. if its confusing i'll rephrase
it. I want to draw many images into one image in memory using win32 gdi
(sample using bitblt or any suggested win32 that works the fastest) since the
.NET gdi is very slow in drawing graphics in my own opinion. I would really
appreciate any help. please any smaple code at all would be very much
approciated. Thank You so much in advace.
Stan Tag: Clipboard.GetData is always returning null Tag: 114848
Writing into a binary file simultaneously from multithreads...
Hi,
I'm building an application that use a binary file format with a proprietary
format.
Files can grow up to several GBytes...
The mecanism of building the data is quite complex and I'd like to know if
multiple threads can -simultaneously- write into the data file...
For example, I know in advance thread one will write the first 100MB, thread
two 50 next MB, and so on. Can I write from multiple threads ?
What objects Have I to use ?
One FileStream and seeking as needing ? One FileStream and several
StreamWriters ? etc ...
Thanks in advance...
Steve Tag: Clipboard.GetData is always returning null Tag: 114847
GDI object usage
In my application I use a large number of panels and textboxes. If I
set the backcolor to each control, the application requires a large
number of GDI objects. They are not freed until Dispose() get called.
for (int i = 0; i<1000; i++)
{
t = new TextBox();
// if I comment this statement, the problem does not occur
t.BackColor = Color.Red;
Controls.Add(t);
}
How can I limit the GDI object usage while the controls are shown (so I
can't dispose them)?
Thanks
Davide Tag: Clipboard.GetData is always returning null Tag: 114844
How to block loading of BHO and band objects into explorer.exe process
Hello!
I have developed a managed BHO and band objects which work almost OK.
One of two problems I currently face is that they are always loaded
into
explorer.exe processs when folder browser window is open (they are not
loaded at initial explorer.exe startup at the user session start).
IObjectWithSite.SetSite implementation is used for checking if process
the controls are in is explorer.exe and if yes the COMException with
HRESULT E_FAIL is thrown. This prevents controls from being activated
but as assemblies are once loaded into process they stay in there until
process ends. .NET band object is not a lightweight component and it
should be prevented from being loaded as useless memory garbage.
My understanding is that explorer loads data into deafult AppDoamin
which
just stays there until process terminates. I have tried to call
AppDomain.Unload(AppDomain.CurrentDomain) but with no success - as
expected. This is obviously a bad solution as any other managed BHOs or
band objects would be unloaded in case of success as well.
Long reasearch pointed me into the direction of unmanaged solution
which uses DllMain return value to prevent loading - false is returned
when module is loaded into explorer.exe process.
Any ideas how can I accomplish selective loading from managed code
only?
Cheers Tag: Clipboard.GetData is always returning null Tag: 114841
Newbie to .NETdevelopment - where to start?
Can anyone point me in the right direction to start .NET
The situation is this, I am a experienced J2EE developer who wants to
familiarize himself at a development level (& of course improve my CV
content). I have used Visual Basic 6 & Visual C++ for many years but not for
the last 4!
I want to convert some of my J2EE app's to .NET but need obviously to do
some good groundwork first in order to see how it's done in the .NET world -
where do I start?
Any good books, web sites, newsgroups (apologies if posted to the wrong
ones!) etc... anyone could recommend would be greatly appreciated!
thanks
harry Tag: Clipboard.GetData is always returning null Tag: 114840
Third Party Controls on Appointments things
Hi
Are there any Third Party Components, conecrning scheduling and task
related things ? (Outlook like)
I Already found Infragistics (seems like performance is an problem).
Which components are good in the look and feel ?
Can anyone tell me some more companys with good working controls? Tag: Clipboard.GetData is always returning null Tag: 114832
Component constructor in .NET 2.0
I looked in the documentation for System.ComponentModel.Component's
constructor but I only noticed a constructor taking no parameters. My
understanding is that there is a second constructor which takes a
System.ComponentModel.IContainer interface object. Has this been the
case in previous .NET releases and has this changed with .NET 2.0 ? Tag: Clipboard.GetData is always returning null Tag: 114824
Calling all Reflection Experts
I want to load a Clickone program using reflection. I tried the following
line of code:
Dim extAssembly As [Assembly] =
[Assembly].LoadFile("C:\Inetpub\wwwroot\test\test.application")
but I get The module was expected to contain an assembly manifest.
(Exception from HRESULT: 0x80131018)
How can I call a ClickOnce application using reflection?
John Wright Tag: Clipboard.GetData is always returning null Tag: 114817
Accessing .NET assemblies from classic ASP/VBScript?
Hi All,
I'm wondering if there is any way to access .NET assemblies from
classic ASP/VBScript?
We have a legacy app that was written using classic ASP and VBScript,
and there's a new facility that one of our developers did in .NET that
we'd like to use with our legacy app. Specifically, we have an online
signup process that is a multi-page form written using classic ASP.
When the user finally completes the signup process, we'd like to
package up the form values and send them off to several objects that we
have defined in our new .NET DLL.
Any thoughts on how to do this?
-Josh
p.s. please observe Followup-to: microsoft.public.dotnet.general --
thanks! Tag: Clipboard.GetData is always returning null Tag: 114815
Passing an enum to a web method
Does anyone know how to pass an enum to a web method?
public enum RptSetStatus
{
PendingApproval,
Active,
}
[WebMethod]
public void SetRptSetLoadComplete(Guid oUserInstance, int nRptSetId,
RptSetStatus eRptSetStatus)
{
}
Tony Tag: Clipboard.GetData is always returning null Tag: 114814
HttpWebRequest with CookieContainer - not deleting cookie - what is wrong here?
when I use HttpWebRequest with CookieContainer object that handles cookies,
i make more than one request and needs to handle cookies being added and
removed between requests, just like a regular web browser like internet
explorer.
if I have this cookie header in a response:
Set-Cookie: <CookieName>=; path=/;expires=01-Jan-1999 00:00:00 GMT
the cookie is not deleted for the next request, and is being sent again with
the old value, while should be deleted - and actually is deleted with
Internet Explorer as client.
is this a bug is there a solution / workaround by manually deleting the
cookie?
please help!
TIA. Tag: Clipboard.GetData is always returning null Tag: 114812
Desperate please help with XmlSerializer, IXmlSerializable and XmlSchemaProvider
Please, please help me - I am desperate.
I have a scenario where I need to send out my object schema in the
WSDL. After hunting I found many posts (on MSDN and google) explaining
that the way to do this is by using the poorly documented
IXmlSerializable interface and the XmlSchemaProvider attribute.
I've done this and it works great - my Schema now comes out correctly
in the WSDL.
Unfortunately, the side effect is that de/serialization no longer
works. Why? Because I have to reimiplement the ReadXml() and
WriteXml() methods manually. But I don't want to - I like the way the
.NET framework serizlizes and deserializes objects. I've seen the code
in Reflector - it is HUGE. So how do I pass the power back to .NET to
do the de/serialization?
Though, as time has gone on I have discovered that no validation occurs
and the only way to do this is to use the ReadXml() method to validate
the incoming XML. So how do I do this (I guess with an
XmlValidatingReader)?
So two questions really:
1) How to hand back power to .NET for de/serizliation using the
IXmlSerializable interface
2) How to do validation in the ReadXml method and then pass the
responsibility back to .NET for deserialization.
Please, please, please help me - I am at my whits end. Tag: Clipboard.GetData is always returning null Tag: 114806
mscorwks.dll faulting on x64
Ok I have a .net 2.0 application that works fine on a x32 machine. Once I
take it to an x64 machine it blows up and throws the following error:
Faulting application scrubberhmo.exe, version 6.2.2278.17960, stamp
44297443, faulting module mscorwks.dll, version 2.0.50727.42, stamp 4333c83c,
debug? 0, fault address 0x0000000000334f60.
It seems completely random. I do one thing it blows up I do it again it
works fine.
Any Ideas on the possible problem?
Thanks in advance. Tag: Clipboard.GetData is always returning null Tag: 114803
checksignature always returning false
I have the following code that in the 1.1 framework worked (signatures are
generated with a 1.1 application)
Since we converted our application to 2.0 the checksignature method always
returns a false.
What has changed?
I can supply the testlicence and the constPublicXMLKey strings if necessary.
Thanks
Chris
Imports System.Security.Cryptography
Imports System.Security.Cryptography.xml
Imports System.Xml
Public Class Form1
Dim testlicence As String = "xxx"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
MsgBox(CheckLicense(testlicence))
End Sub
Public Shared Function CheckLicense(ByVal inputXML As String) As String
Try
Dim constPublicXMLKey As String = "xxx"
Dim cspParams As New CspParameters
cspParams.Flags = CspProviderFlags.UseMachineKeyStore
Dim rsaKey As RSACryptoServiceProvider = New
RSACryptoServiceProvider(cspParams)
' Create a SignedXml.
Dim MYsignedXml As New SignedXml
Dim objRSAkeyPair As RSA = RSA.Create()
objRSAkeyPair.FromXmlString(constPublicXMLKey)
Dim keyInfo As New keyInfo
keyInfo.AddClause(New RSAKeyValue(objRSAkeyPair))
MYsignedXml.KeyInfo = keyInfo ' Load the SignedXML Document
Dim xmlDocument As New XmlDocument
xmlDocument.PreserveWhitespace = True
xmlDocument.LoadXml(inputXML) 'Verify the Signature
Dim nodeList As XmlNodeList =
xmlDocument.GetElementsByTagName("Signature")
MYsignedXml.LoadXml(CType(nodeList(0), XmlElement))
If MYsignedXml.CheckSignature() Then
Return "True"
Else
Return "False"
End If
Catch ex As Exception
Throw ex
End Try
End Function
End Class Tag: Clipboard.GetData is always returning null Tag: 114802
Why does a private implementation of ICloneable work?
Can someone explain why you can implement ICloneable with a private
function and it works?
e.g.
Imports System
Public Class BusinessObject
Implements ICloneable
Private Function privateClone() As Object Implements
ICloneable.Clone
Dim MyClone As Object = makeClone()
Return MyClone
End Function
End Class
Does that fact that the Clone is public on ICloneable mean that the
"private" above is ignored when the object is being dealt with as type
ICloneable? Tag: Clipboard.GetData is always returning null Tag: 114799
Can't move tif file after reading it to picturebox
Hi Folks,
The following code crashes on the last statement with a "The process
cannot access the file because it is being used by another process"
exception (fiFax is a FileInfo object):
Dim picbox As New PictureBox
picbox.Image = Drawing.Image.FromFile(fiFax.FullName)
picbox.Dispose()
fiFax.MoveTo(fiFax.Directory.FullName & "\Old\" &
fiFax.Name) ' Exception!!!
If I put the "fiFax.MoveTo" statement before the "FromFile" it works.
Why does the picturebox keeps the file locked even after it is
disposed? How can I release it?
TIA Tag: Clipboard.GetData is always returning null Tag: 114798
Avoid drag and drop SHDocVw
Hello:
I'm using an embedded AxWebBrowser in my application but it has one problem
: everything you drag and drop over it works, so you can navigate to any
link only with drag and drop, and you can open any folder doing the same
thing.
¿How can avoid this? I need to make a robust component and drag and drop
isn't very secure.
Thanks,
Juan Tag: Clipboard.GetData is always returning null Tag: 114795
Decode subject line of email?
Is it really true that the .net framework does not contain a functions
for decoding the subject line of a raw email message?
I've found the MailMessage class and the TransferEncoding enumerator,
but this can only be used to encode en mail - not decode. (Note: The
MailMessage class is new in .net 2.0.)
Do I really have to decode these =?iso8859-1?Q? subject strings
manually? Tag: Clipboard.GetData is always returning null Tag: 114791
error message
Hi,
why trying to execute my projet, i have these messages errors:
"The file 'filename' cannot be copied to the run directory."
"Could not copy temporary files to the output directory"
Please can you help me?
Liliane TAGU Tag: Clipboard.GetData is always returning null Tag: 114790
[MSH beginner question] how to test for file existence and delete them
in C# I could very easily wrtie Directory.Exsists(aDirectory)
I would like to do the same thing with MSH.
I would like to avoid the following trickery
if ( [SYstem.IO]Directory.Exists("file") ) {}
There should some Commandlet or something.
Any clues?
Basically I would like to test for the existance of a directory and, if it
does exist, delete it (it might not be empty)
Any tip? Tag: Clipboard.GetData is always returning null Tag: 114783
Resource Leak from XslCompiledTransform
Hello there,
Are there anybody who is using the XslCompiledTransform that comes
with .net framework, which was said to be a replacement of the
XslTransform class?
I found that the class has some issues when the xsl file contains scripts.
The XslCompiledTransform uses the CodeDom to compile the scripts
within the xsl file into .net assembly and load them into the current
AppDomain. Some temporary files would be generated during the
compilation in the temp folder.
This behavior leads to two issues.
1, The memory consumption of the current AppDomain, i.e. the
working application keeps growing up if we compile more and more
xsl files that contain scripts. We have no way to identify the assembly
generated from the compiled scripts within the xsl files. Thus we can
not release the resources associated with the xsl files.
2, The temporary assembly files can not be removed while the
application is executing, since they are engaged by it. The TempFiles.Delete
method always fails within the application, consequently. And after
running the application for several times, the temp folder might be
piled up with the those temporary files.
Are there any approaches to solve these problems?
--
Best Regards,
W. Jordan Tag: Clipboard.GetData is always returning null Tag: 114782
ftpwebreques async upload, active transfer problem.
Hi, i'm having an inssure implementing and ftpwebrequest upload, using
an active transfer problem. I'm trying to catch the "425 Can't open
data connection" error returned if an ftp client in active mode tries
to connect to an ftp server, and one or the other or both are not
configured properly.
Here is the code in question:
........
Dim result As IAsyncResult
result = request.BeginGetRequestStream(New
AsyncCallback(AddressOf EndGetStreamCallback), state)
waitObject.WaitOne()
..................
Private Sub EndGetStreamCallback(ByVal ar As IAsyncResult)
'User created class to handle async file transfer
Dim state As FtpState = CType(ar.AsyncState, FtpState)
'Stream to send to ftp server
Dim requestStream As Stream = Nothing
Try
' attach the requestStream to the FTPWEBREQUEST
requestStream = state.Request.EndGetRequestStream(ar)
Catch ex As System.Net.WebException
' handle ....................
........................
A breakpoint has been place at "Dim state As FtpState =
CType(ar.AsyncState, FtpState)", the first line in
EndGetStreamCallback. When the ftpwebrequest is set to use passive
mode, the code breaks at the right line. When the ftpwebrequest is set
to use active mode, and the conditions are as stated above for the
client and server, the code never gets to the break point and hangs
forever at "waitObject.WaitOne()". If i set the ftpwebrequest to use
syncronous transfer and the condistions are as stated above for the
client and server, the request returns a timeout.
So if my request never even gets to the EndGetStreamCallback code, how
can i check for connection errors/timeouts?
TIA, lushdogg Tag: Clipboard.GetData is always returning null Tag: 114779
My objects seem to be put into the clipboard ok and Clipboard.ContainsData()
is returning true but when I GetData() the object returned is null. What am
I doing wrong??
Re: Clipboard.GetData is always returning null by Dave
Dave
Wed Apr 12 22:27:36 CDT 2006
I'm putting two different types of objects in the clipboard but both are
marked Serializable.
"Dave" <none@nowhere.com> wrote in message
news:OB3XTmqXGHA.1192@TK2MSFTNGP04.phx.gbl...
> My objects seem to be put into the clipboard ok and
> Clipboard.ContainsData() is returning true but when I GetData() the object
> returned is null. What am I doing wrong??
>
Re: Clipboard.GetData is always returning null by Dave
Dave
Wed Apr 12 23:08:56 CDT 2006
The objects I'm trying to put in the clipboard are remoted objects (they
inherit MarshalByRefObject). Could that be the problem even though they are
also marked with the Serializable attribute? Don't objects HAVE to be
serializable to be remotable??