Max Length on ProcessStartInfo.Arguments
I have noticed that when I try to run a process using ProcessStartInfo
to set a really long argument, over 33,000 characters. The whole
string doesn't get passed into the process being started.
Specifically I am using the System.Diagnosis.Process class to run
csc.exe and compile our software product because we have a solution
with over 170 projects and it takes 40 minutes to load and build in
visual studio. But by parsing the solution and project files I can
build it in under 5 minutes with a custom written app. The only
problem I have is a couple of projects have so many files in them now,
when I create the compile string it cuts off the end of it before
starting csc and so that specific project doesn't run. Does anyone
have any thoughts on this?
Thanks for the help.
If you can email me back at
jonathan.p.crawford@_TIGER_gmail.com
minus the cat, I would appericate it. Tag: Is CLR a process or a thread? Tag: 82094
.Net SP1
Does anyone have the link to the latest service pack? I was able to fin
.Net 1.0 SP3 but not .Net 1.1 SP1. Tag: Is CLR a process or a thread? Tag: 82088
VCC+ and .Net assemblies
Has anyone used the COM interop to acess .Net asseblies from an unmanaged
C++ application?
For various reasons we have a legacy VS 6.0 C++ application that we would
like to compile with VS .Net and without the /clr switch and using the COM
interop use the XML features available in the .Net Framework.
Since we are new to .Net we need a cookbook method to expose Ssytem.XML as
COM object and then add it to our VC++ project.
Any help is greatly appreciated sine we are unable to figure it out from the
microsoft documentation.
Regards
Ron Harter Tag: Is CLR a process or a thread? Tag: 82087
Accessing POTS modem through framework?
Is using an analog modem simply a dead art form or is there still
functionality within the .NET Framework for accessing a modem on the
computer, sending AT commands and sending/receiving character data? At a
very minimum, I'd like to develop a small application that will dial a list
of phone numbers from a phonebook and check the modem response strings to
see if the call is answered or not.
Does anyone have any experience with this using the .NET Framework? Any
help/suggestions would be greatly appreciated.
Thanks in advance,
Patrick Tag: Is CLR a process or a thread? Tag: 82086
Process class and .NET security
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C494E7.226DE480
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
I am using the Process class in my application, right at the beginning =
of the static Main method. I am using the Process class to know if =
another instance of my application is currently running. If my =
application is already running, I will exit.
This works fine on my development machine. But if I run it on a =
deployment machine, I get the error "Common Language Runtime Debugging =
Services : Application has generated an exception that could not be =
handled". I cannot run the remote debugger since the application is =
running in another domain and this domain doesn't trust my dev machine =
(which is in another domain)
Currently, my only workaround is to comment the code. I am not =
satisfied with this behavior. I though of going throught the Win32 API =
but I would prefer a .NET solution to my problem. I know the problem is =
with the Process class. In the .NET SDK documentation, there is 2 lines =
of text about a permission used to access the Process class. How do I =
bypass the security? How do I give the required permission to my =
application? =20
Thank you,
Louis-Philippe
Here is the code commented out
// Before starting the application, check if the same application
// is already running. If so, show a message box to the user
// indicating that the application is already running and exit the =
program
try=20
{
Process currentProcess =3D Process.GetCurrentProcess();
foreach (Process process in =
Process.GetProcessesByName(currentProcess.ProcessName))=20
{
if (currentProcess.Id !=3D process.Id)=20
{
LogManager.Log(typeof(ClientApp), APP_ERROR_TEXT, =
LogType.Error, LogLevel.High);
MessageBox.Show(APP_ERROR_TEXT, APP_ERROR_CAPTION, =
MessageBoxButtons.OK, MessageBoxIcon.Error);
Shutdown();
return;
}
}
}=20
catch=20
{
LogManager.Log(typeof(ClientApp), APP_GETPROCESS_EXCEPTION_TEXT, =
LogType.Error, LogLevel.High);
}
------=_NextPart_000_0008_01C494E7.226DE480
Content-Type: text/html;
charset="iso-8859-1"
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=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I am using the Process class in my =
application,=20
right at the beginning of the static Main method. I am using the =
Process=20
class to know if another instance of my application is currently =
running. =20
If my application is already running, I will exit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This works fine on my development =
machine. =20
But if I run it on a deployment machine, I get the error "Common =
Language=20
Runtime Debugging Services : Application has generated an =
exception that=20
could not be handled". I cannot run the remote debugger since the=20
application is running in another domain and this domain doesn't trust =
my dev=20
machine (which is in another domain)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Currently, my only workaround is to =
comment the=20
code. I am not satisfied with this behavior. I though of =
going=20
throught the Win32 API but I would prefer a .NET solution to my =
problem. I=20
know the problem is with the Process class. In the .NET SDK =
documentation,=20
there is 2 lines of text about a permission used to access the Process=20
class. How do I bypass the security? How do I give the =
required=20
permission to my application? </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thank you,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Louis-Philippe</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Here is the code commented =
out</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<P><FONT face=3DCourier size=3D2>// Before starting the application, =
check if the=20
same application</FONT></P>
<P><FONT face=3DCourier size=3D2>// is already running. If so, show a =
message box to=20
the user</FONT></P>
<P><FONT face=3DCourier size=3D2>// indicating that the application is =
already=20
running and exit the program</FONT></P>
<P><FONT face=3DCourier size=3D2>try </FONT></P>
<P><FONT face=3DCourier size=3D2>{</FONT></P>
<P><FONT face=3DCourier size=3D2> Process =
currentProcess =3D=20
Process.GetCurrentProcess();</FONT></P>
<P><FONT face=3DCourier size=3D2> foreach (Process =
process in=20
Process.GetProcessesByName(currentProcess.ProcessName)) </FONT></P>
<P><FONT face=3DCourier size=3D2> {</FONT></P>
<P><FONT face=3DCourier =
size=3D2> if=20
(currentProcess.Id !=3D process.Id) </FONT></P>
<P><FONT face=3DCourier =
size=3D2> =20
{</FONT></P>
<P><FONT face=3DCourier=20
size=3D2> &nbs=
p;=20
LogManager.Log(typeof(ClientApp), APP_ERROR_TEXT, LogType.Error,=20
LogLevel.High);</FONT></P>
<P><FONT face=3DCourier=20
size=3D2> &nbs=
p; MessageBox.Show(APP_ERROR_TEXT,=20
APP_ERROR_CAPTION, MessageBoxButtons.OK, =
MessageBoxIcon.Error);</FONT></P>
<P><FONT face=3DCourier=20
size=3D2> &nbs=
p; Shutdown();</FONT></P>
<P><FONT face=3DCourier=20
size=3D2> &nbs=
p;=20
return;</FONT></P>
<P><FONT face=3DCourier=20
size=3D2> }</FONT></P>
<P><FONT face=3DCourier size=3D2> }</FONT></P>
<P><FONT face=3DCourier size=3D2>} </FONT></P>
<P><FONT face=3DCourier size=3D2>catch </FONT></P>
<P><FONT face=3DCourier size=3D2>{</FONT></P>
<P><FONT face=3DCourier size=3D2> =20
LogManager.Log(typeof(ClientApp), APP_GETPROCESS_EXCEPTION_TEXT, =
LogType.Error,=20
LogLevel.High);</FONT></P>
<P><FONT face=3DCourier size=3D2>}</FONT></P>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0008_01C494E7.226DE480-- Tag: Is CLR a process or a thread? Tag: 82085
Globalizing declaration of OleDbConnection and OleDbCommand
Hello. I'm working in C#.
I have a form in which I bind data to a grid inside the Page_Load method
(constructor? sorry, don't quite have the lingo yet)
The form also includes a textbox. Depending on what the user types into
the textbx, I repopulate the grid, i.e. rebind new data to it.
I would like not to have to include the following two lines in both
Page_Load and in the event handler I wrote for the text box:
OleDbConnection MyConnection = new OleDbConnection
OleDbCommand MyCommand = new OleDbCommand();
I'm looking to broaden the scope of these declarations to cover both of
the above situations, but don't quite know where to put the
declarations.
Thoughts?
Thanks so much,
Google Jenny
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! Tag: Is CLR a process or a thread? Tag: 82084
Array.IndexOf() and an array of structs
Hi ng,
I would like to search an array of structs for an object whose myName
field (a string) equals the given input search string. Is this
possible to do with IndexOf? Here's an example:
---------------------
public struct SomeRecord
{
string myName;
int idata;
float fdata;
}
SomeRecord[] records = new SomeRecord[10];
// Load array with some data...
// Look for first SomeRecord object whose myName field equals "John"
int index = records.IndexOf("John");
---------------------
TIA. Tag: Is CLR a process or a thread? Tag: 82080
Millionaire at 31 ... on the Internet! Listen to how he is doing it.
"Hi, my name is theeb basheer.
Since months, I have tried everything, nothing worked
out. The Internet is so competitive, I was only a number.
Now I?m so excited seeing paychecks from my online
business coming in.
Everything changed when I read Stephan Ducharme?s
course "How to get 1 Million visitors on your website
without paying a dime in advertising." If you are
tired of working an entire month for 10 or 100 bucks,
Click here. Stephan is different.
He is a real player, doing it himself à He is getting
more than 20,000 visitors raging on his site each day
to learn his techniques. He has just created the new rules
to online marketing, that?s why everybody is now
calling him the "Free Ad Guru".
His success his so huge, he paid cash for a Porsche 911
Carrera convertible in 28 days. I personally recommend
that you see what he has to say...Today!
Click here : http://www.geocities.com/theeb13 Tag: Is CLR a process or a thread? Tag: 82076
Fax from an ASP.NET page via a shared fax printer
Can anyone point me in the right direction in able to fax an web page
via a shared fax printer?
We have a Canon ir3100 multi-function printer and we're able to
'print' Word docs, etc and select to print using its shared fax driver
and enter the fax number, which in turn spools it and faxes it off.
TIA
Dan. Tag: Is CLR a process or a thread? Tag: 82066
difference btw Framework and Framework Redist
Hello,
i'm wondering what is the difference between .NET Framework 1.1 and .NET
Framework Redistribuable 1.1 ??? Tag: Is CLR a process or a thread? Tag: 82060
Event Log .net Class problem
hi all. my problem is like this: i'm fetching a security event log
messege(Local Computer/DC) ID number 566 into an EntryWrittenEventArgs
Object. but when i'm reading the Messege Property, i'm getting %{SomeGuid}
instead of the actual information, in the String. i need to search for the
Object name from inside the Messege,(a DN of an object) but instead i'm
reading those Replacement Strings Instead... i must mention that i'm seeing
this problem in event 566 specificlly. on other events like event 560, the
information is written correctly. in the Reguler event log viewer, the
messege appear correctly. any help will be appreciated.
--
Omer Maydan
MCSE,Security+ Tag: Is CLR a process or a thread? Tag: 82041
Not support Web Server
I have installed the Visual Studio .Net 2003 Professional in Windows 2000
Professional SP4 with IIS 5.1. When I try to open the ASP.NET Web Application
project in Visual Studio 2003, the following error displayed.
"Visual Studio .NET has detected that the specified Web Server is not
running ASP.NET version 1.1. You will be unable to run ASP.NET Web
Applications or services."
Anyone knowing what is the reasons and solutions.
Thank you.
- Dennis - Tag: Is CLR a process or a thread? Tag: 82039
Metafile problem
I am having a problem using DrawImage to scale metafiles. Here is what
I am doing:
Metafile mapImage = new Metafile("C:\\image.wmf");
If I draw the entire metafile it draws correctly:
g.DrawImage(mapImage, 0, 0);
If I try to scale the metafile into the graphic, it does get scaled
correctly but tho origin is moved so what gets drawn in position 0,0 is
not position 0,0 in the metafile even though both rectangles have 0,0
values.
g.DrawImage(bitmapMap, new Rectangle(0, 0, bitmapDest.Width,
bitmapDest.Height), new Rectangle(0, 0, mapImage.Width,
mapImage.Height), GraphicsUnit.Pixel);
In fact the above statement SHOULD display the entire metafile but it
only displays a portion on the lower right corener of the metafile.
Also, if instead of using a metafile, I use a Bitmap, then I don't have
this problem (i.e Bitmap mapImage = new Bitmap("C:\\image.bmp"))
Thanks,
Jeronimo Tag: Is CLR a process or a thread? Tag: 82032
Can I add a FileSystemWatcher or Timer objects into application dynamically?
Can I add a FileSystemWatcher or Timer objects into application dynamically?
that's means i don't want to use <object runat="server" scope="application"
...... />.
and i just want to use the dynamic methods just like Application["timer1"] =
timerobject; to add the object into application and keep all of the events
of the objects inside application can be fired up automatically in
application behind-end.
for example:
*Global.asax
<script language="C#" runat="server">
public void Application_OnStart(){
FileSystemWatcher watcher = new FileSystemWatcher();
Application.Add("watcher1", watcher);
Application["watcher1"].Path = "D:\abc";
Application["watcher1"].NotifyFilter = NotifyFilters.LastAccess |
NotifyFilters.LastWrite | NotifyFilters.FileName |
NotifyFilters.DirectoryName | NotifyFilters.Size;
Application["watcher1"].Filter = "*.*";
Application["watcher1"].Changed += new
FileSystemEventHandler(OnChanged);
Application["watcher1"].Created += new
FileSystemEventHandler(OnChanged);
Application["watcher1"].Deleted += new
FileSystemEventHandler(OnChanged);
Application["watcher1"].EnableRaisingEvents = true;
Application["watcher1"].BeginInit();
}
private static void OnChanged(object source, FileSystemEventArgs e)
{
/* somethings which need to be done */
}
public void Application_OnEnd(){
string[] appkeys = Application.Allkeys;
foreach (string appkey in appkeys)
{
if (appkey.StartsWith("watcher")==true)
{
Application[appkey].EndInit();
Application[appkey].Dispose();
}
}
Application.RemoveAll();
}
</script>
*Addwatcher.aspx
<script language="C#" runat="server">
pivate void Page_Load(){
FileSystemWatcher watcher = new FileSystemWatcher();
Application.Add("watcher2", watcher);
Application["watcher2"].Path = "D:\webcustomer";
Application["watcher2"].NotifyFilter = NotifyFilters.LastAccess |
NotifyFilters.LastWrite | NotifyFilters.FileName |
NotifyFilters.DirectoryName | NotifyFilters.Size;
Application["watcher2"].Filter = "*.*";
Application["watcher2"].Changed += new
FileSystemEventHandler(OnChanged);
Application["watcher2"].Created += new
FileSystemEventHandler(OnChanged);
Application["watcher2"].Deleted += new
FileSystemEventHandler(OnChanged);
Application["watcher2"].EnableRaisingEvents = true;
Application["watcher2"].BeginInit();
}
private static void OnChanged(object source, FileSystemEventArgs e)
{
/* somethings which need to be done */
}
</script>
*Delwatcher.aspx
<script language="C#" runat="server">
pivate void Page_Load(){
Application["watcher1"].EndInit();
Application["watcher1"].Dispose();
Application.Remove("watcher1");
}
</script>
Can i do like this? and will it be work? Tag: Is CLR a process or a thread? Tag: 82026
Resource Sharing
I have noticed that successive calls to ResourceManager.GetObject with
the same paramters return references to different objects.
This is fine when a resource is only being used once (at a time) or
when an application intends to edit the returned object at runtime
(and each resource consumer needs it's own copy to edit).
Unfortunatly, this is a major problem when you need to share
resources.
For example, I would like to use embedded resources for textures of
objects in my C# based 3D engine. If several objects use the same
geometry, textures or other resource, they should all share a
reference to the same resource object.
Is there functionality in the .NET framework for shared resources?
If not, is my only option to code my own SharedResourceManager class?
Thanks,
Brandon Bloom Tag: Is CLR a process or a thread? Tag: 82023
Failure to install .Net Framework 1.1 sp1....
I was unable to install the sp1 download for .net Framework 1.1. The IE
window reloaded as if all was fine but was simply given the info "was not
able to install". I then downloaded the executable for the patch and tried
installing it manually. The windows installer window popped open and tried to
load got about 4 bars lagged for a while than it closed and I recieved the
the info "windows installer could not be accessed......".
I have searched and searched and have not found any information related to
my problem and am at a loss. Please help! Tag: Is CLR a process or a thread? Tag: 82019
PictureBox Locked Property Question
I am trying to put a picture on a form and then when the user clicks
on the picture/image they can resize that image with the sizer arrows
(not the whole form, just the picturebox.) I thought this would be
via the locked property , but it did not allow me to click the
picture.
Does anyone have any idea how I can accomplish this? Thank you. Tag: Is CLR a process or a thread? Tag: 82013
Windows messages to .NET events
I recall seeing a document that maps Windows messages to .NET events. Does
anybody know where that document might be ? I can not find it under MSDN. Tag: Is CLR a process or a thread? Tag: 82010
Problem installing .NET framework sp1.1 for window server 2003
Hi,
I have problem installing the .net framework SP1.1 for window 2003. It just
couldn't install and no error code was given.
Anyone have idea? thanks Tag: Is CLR a process or a thread? Tag: 82009
CryptProtectData key.
Hi all,
I'm considering to use the Data Protection API CryptProtectData, with
the flag set for CRYPTPROTECT_LOCAL_MACHINE.
The documentation says this "associates the data encrypted with the
current computer instead of with an individual user".
On what computer characteristics is the secret key (?) based then? What
computer modification may break it? Or is it possible to obtain the same
key on another computer somehow (reasonably mimiced hardware, with a
ghosted OS perhaps?)
Thanks heaps,
Koen.
--
Notice: Remove packaging material from e-mail address before use. Tag: Is CLR a process or a thread? Tag: 82003
How to launch a windows app
I want to launch a windows application from a windows service. The code in
the windows service does not need to wait for the windows application to
finish running before it continues.
What code should I use to do this ?
Thanks,
Craig Tag: Is CLR a process or a thread? Tag: 82000
Matrix computation in .NET
Hi,
Does anybody know where I can find the matrix computation components in .NET
framework?
Do I need to use a third-party one or there's one that comes with the
framework libraries?
Thanks!
Rick Tag: Is CLR a process or a thread? Tag: 81992
NullReferenceException using static members in a multi-thread .exe
Using a class with static members in a multi-thread executable results in
'System.NullReferenceException' exception.
This happen only if the class is not initialized (calling any static member)
before
trheads start.
The exception is not throw if:
- If I invoke a static member in main before threads start.
- The class is included in the application project and I don't use an
external library.
Following there is a sample of a solution that have the problem.
All happen with: .Net Framework 1.1.4322, Windows 2000 SP4, Visual Studio
.Net 2003 7.1.3088.
Any help would be appreciated.
Thanks Tag: Is CLR a process or a thread? Tag: 81985
New to dot net
Dear friends,
I am a fresh candidate who like to learn dot net. Is there any free
downloads so that i can do some sample programs and run it.or is there
anyother way to learn it thru net.
Please guide me.
thanks. Tag: Is CLR a process or a thread? Tag: 81979
It's Bug? Or it's high way of thinking?
I'm write string in textfile in this sample. When it done, i mast have three
files. Every file mast contain one string. Realy only one file contain
string, what maked inside of my metod (Write). vbc-compiler don't say about
erros. When i define variable as class-field, StreamWriter to act very
strange. It didn't write string in file!
Why?
It's Bug?
Or it's high way of thinking?
May be needs any qualifier before class-fields?
Help me please:)
'---------------------------
Imports System.IO
Imports System.Text
Imports SC = System.Console
Module Simple
Sub Main()
Dim rez As Object = (New
TestGuiLog("StreamWriterP.txt")).Write("StreamWriterDemoP")
End Sub
End Module
Public Class TestGuiLog
Friend m_swp As StreamWriter
Friend m_swf As StreamWriter
Sub New()
End Sub
Sub New(ByRef pstr As String)
m_swf = New StreamWriter("StreamWriterF.txt", True)
m_swf.WriteLine("StreamWriterDemoFC on {0}", DateTime.Now)
m_swp = New StreamWriter(pstr, True)
SC.WriteLine("This is constructor with " + pstr )
End Sub
Function Write(ByVal pstr As String) As Integer
If Not (m_swp Is Nothing) Then
SC.WriteLine("Begining metod with " + pstr )
m_swp.WriteLine( pstr + " on {0}", DateTime.Now)
m_swf.WriteLine("StreamWriterDemoFM on {0}", DateTime.Now)
Dim sw As New StreamWriter("StreamWriter.txt", True)
sw.WriteLine("StreamWriterDemo on {0}", DateTime.Now)
sw.Close()
SC.WriteLine("End metod with " + pstr + " Ok:)")
Else
SC.WriteLine("End metod with " + pstr + " bad:(")
Return 0
End If
Return 1
End Function
Protected Overrides Sub Finalize()
If Not (m_swf Is Nothing) Then
m_swf.Close()
m_swf = Nothing
End If
If Not (m_swp Is Nothing) Then
m_swp.Close()
m_swp = Nothing
End If
SC.WriteLine("This is dectructor:)")
End Sub
End Class Tag: Is CLR a process or a thread? Tag: 81978
Form deserialization
Hi, i'm working in a form generation tool=2E I've got a base class=
TpForm to build all the windows in the application and now i=
want to be able to design subforms, but the problem is that=
these subforms are downloaded by reflection from different=
repositories in design and run-time; so, what i've done is build=
a custom TpFormSerializer that replace the codeDOM object=
creation expresion in InitializeComponent(), and attachi it to=
TpForm class=2E For example, if i have the line
this=2ESUBV194i1 =3D new=
Fujitsu=2ETpnet=2EUser=2EInterface=2EWin=2ESUBV194i1()
this would be replaced with
this=2ESUBV194i1 =3D AddSubForm("SUBV194i1", "SUBV194i1");
and i also change the subform declaration statement, so subform=
type dependence is not neccesary in the designer project, in=
this way:
private Fujitsu=2ETpnet=2EUser=2EInterface=2EWin=2ESUBV194I1=
SUBV194i1;
with
private TpForm SUBV194i1;
The problem is that in the deserialize method i simply invoke the=
base serialization manager and it seems that the IDesignerHost's=
CreateComponent method is not able to create the subform at=
startup,
am i missing something? Do i have to custom the deserialization=
process as well in any manner?
using System;
using System=2ECodeDom;
using System=2ECodeDom=2ECompiler;
using System=2EComponentModel;
using System=2EComponentModel=2EDesign;
using System=2EComponentModel=2EDesign=2ESerialization;
using System=2EDiagnostics;
using System=2EDrawing;
using System=2EReflection;
using System=2EWindows=2EForms;
using System=2EText;
using System=2EIO;
using Microsoft=2ECSharp;
using Fujitsu=2ETpnet=2ECommon;
namespace Fujitsu=2ETpnet=2EUser=2EInterface=2EDesign
{
=09/// <summary>
=09/// Serializador personalizado del tipo TpForm=2E
=09/// </summary>
=09public class TpFormSerializer : CodeDomSerializer
=09{
=09=09private IDesignerSerializationManager _manager =3D null;
=09=09public override object Serialize(IDesignerSerializationManager=
manager, object value)
=09=09{
=09=09=09CodeDomSerializer baseSerializer =3D null;
=09=09=09this=2E_manager =3D manager;
=09=09=09object codeObject =3D null;
=09=09=09try
=09=09=09{
=09=09=09=09//Obtener el serializador por defecto
=09=09=09=09baseSerializer =3D=
(CodeDomSerializer)manager=2EGetSerializer(typeof(UserControl),=
typeof(CodeDomSerializer));
=09=09=09=09//Invocar al serializador por defecto
=09=09=09=09codeObject =3D baseSerializer=2ESerialize(manager, value);=09=09=09
=09=09=09=09//Obtenemos el nombre del objeto (ventana)
=09=09=09=09string name =3D=
value=2EGetType()=2EGetProperty("Name")=2EGetValue(value,=
null)=2EToString();
=09=09=09=09//Obtenemos la declaraci?n del tipo del contexto
=09=09=09=09CodeTypeDeclaration typeDeclaration =3D=
(CodeTypeDeclaration)manager=2EContext[typeof(CodeTypeDeclaration)=
];
=09=09=09=09//Interceptamos el ?rbol de c?digo que declara el objeto
=09=09=09=09TraceCode(typeDeclaration);
=09=09=09=09typeDeclaration =3D=
(CodeTypeDeclaration)SerializeFormDeclaration(typeDeclaration,=
name);
=09=09=09=09TraceCode(typeDeclaration);
=09=09=09=09//Interceptamos el ?rbol de c?digo que crea el objeto
=09=09=09=09codeObject =3D SerializeFormCreation(codeObject, name);
=09=09=09}
=09=09=09catch(Exception e)
=09=09=09{
=09=09=09=09MessageBox=2EShow("iTool - Error serializando ventana: {" +=
e=2EMessage + "}");
=09=09=09}
=09=09=09return codeObject;
=09=09}
=09=09public override object=
Deserialize(IDesignerSerializationManager manager, object=
codeObject)
=09=09{
=09=09=09object objResp =3D null;
//=09=09=09try
//=09=09=09{
=09=09=09=09//Obtener el serializador por defecto
=09=09=09=09CodeDomSerializer baseSerializer =3D=
(CodeDomSerializer)manager=2EGetSerializer(typeof(UserControl),=
typeof(CodeDomSerializer));
=09=09=09=09TraceCode(codeObject);
=09=09=09=09CodeTypeDeclaration typeDeclaration =3D=
(CodeTypeDeclaration)manager=2EContext[typeof(CodeTypeDeclaration)=
];
=09=09=09=09//Invocar la deserializaci?n b?sica
=09=09=09=09objResp =3D baseSerializer=2EDeserialize(manager, codeObject);
//=09=09=09}
//=09=09=09catch(Exception e)
//=09=09=09{
//=09=09=09=09MessageBox=2EShow("iTool - Error deserializando ventana: {" +=
e=2EMessage + "}");
//=09=09=09}
=09=09=09return objResp;
=09=09}
=09=09
=09=09#region Private methods
=09
=09=09private object SerializeFormCreation(object codeObject, string=
name)
=09=09{
=09=09=09CodeStatementCollection tree =3D=
(CodeStatementCollection)codeObject;
=09=09=09foreach(CodeStatement statement in tree)
=09=09=09{
=09=09=09=09if(CheckForCreationStatement(statement, name))
=09=09=09=09{
=09=09=09=09=09//Creaci?n de la llamada al m?todo personalizado que crea la=
ventana
=09=09=09=09=09CodeMethodInvokeExpression methodInvoke =3D new=
CodeMethodInvokeExpression(
=09=09=09=09=09=09new CodeThisReferenceExpression(),
=09=09=09=09=09=09"AddSubForm",
=09=09=09=09=09=09new CodeExpression[] {new CodePrimitiveExpression(name),=
new CodePrimitiveExpression(name)});
=09=09=09=09=09//Reemplazar parte derecha de la sentencia de asignaci?n
=09=09=09=09=09((CodeAssignStatement)statement)=2ERight =3D methodInvoke;
=09=09=09=09=09break;
=09=09=09=09}
=09=09=09}
=09=09=09//Retornar arb?l de c?digo de la ventana
=09=09=09return codeObject;
=09=09}
=09
=09=09private object SerializeFormDeclaration(object codeObject,=
string name)
=09=09{
=09=09=09if(codeObject is CodeTypeDeclaration)
=09=09=09{
=09=09=09=09string comment =3D "El c?digo de esta pantalla ha sido generado=
de forma autom?tica con la herramienta ";
=09=09=09=09comment +=3D "\"iTool - Dise?ador de ventanas\"";
=09=09=09=09CodeTypeDeclaration tree =3D (CodeTypeDeclaration)codeObject;
=09=09=09=09tree=2EComments=2EClear();
=09=09=09=09tree=2EComments=2EAdd(new CodeCommentStatement(comment));=09=09=09=09
=09=09=09=09foreach(CodeMemberField field in tree=2EMembers)
=09=09=09=09{
=09=09=09=09=09if(CheckForCodeMemberField(field, name))
=09=09=09=09=09{=09=09=09=09=09=09
=09=09=09=09=09=09field=2EType =3D new CodeTypeReference("TpForm");
=09=09=09=09=09=09break;
=09=09=09=09=09}
=09=09=09=09}
=09=09=09}
=09=09=09return codeObject;
=09=09}
=09=09
=09=09private bool CheckForCreationStatement(object codeObject,=
string name)
=09=09{=09
=09=09=09bool bResult =3D false;
=09=09=09try
=09=09=09{
=09=09=09=09if(codeObject is CodeAssignStatement) =09=09=09=09=09
=09=09=09=09{=09=09=09=09=09
=09=09=09=09=09CodeExpression left =3D=
((CodeAssignStatement)codeObject)=2ELeft;
=09=09=09=09=09if(left is CodeFieldReferenceExpression)
=09=09=09=09=09{
=09=09=09=09=09=09if(((CodeFieldReferenceExpression)left)=2EFieldName=2EEquals(na=
me))
=09=09=09=09=09=09=09return true;
=09=09=09=09=09}=09=09=09=09=09
=09=09=09=09}
=09=09=09}
=09=09=09catch(Exception e)
=09=09=09{
=09=09=09=09bResult =3D false;
=09=09=09=09MessageBox=2EShow("iTool - Error serializando ventana: {" +=
e=2EMessage + "}");
=09=09=09}
=09=09=09return bResult;
=09=09}
=09=09
=09=09private bool CheckForCodeMemberField(object codeObject, string=
name)
=09=09{
=09=09=09bool bResult =3D false;
=09=09=09string comment =3D "(iTool) Declaraci?n de subventana -" + name=
+ "-";
=09=09=09try
=09=09=09{
=09=09=09=09if(codeObject is CodeMemberField)
=09=09=09=09{
=09=09=09=09=09CodeMemberField field =3D (CodeMemberField)codeObject;
=09=09=09=09=09if(field=2EName=2EEquals(name))
=09=09=09=09=09{
=09=09=09=09=09=09field=2EComments=2EClear();
=09=09=09=09=09=09field=2EComments=2EAdd(new CodeCommentStatement(comment));
=09=09=09=09=09=09return true;
=09=09=09=09=09}
=09=09=09=09}
=09=09=09}
=09=09=09catch(Exception e)
=09=09=09{
=09=09=09=09bResult =3D false;
=09=09=09=09MessageBox=2EShow("iTool - Error serializando ventana: {" +=
e=2EMessage + "}");
=09=09=09}
=09=09=09return bResult;
=09=09}
=09=09#endregion
=09}
}
-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>BwC+U94s9Um6CR3dmqlx/Q=3D=3D</Id> Tag: Is CLR a process or a thread? Tag: 81974
Function Address
Hi
How can i get function or method memory addres in C#?
(it's include managed code or unsafe)
Regard
Emad Tag: Is CLR a process or a thread? Tag: 81972
SMTP Sending to junk folder
Hi,
I am writing a program that sends emails to my hotmail account from my
account at work I'm using the standard .NET SMTP class and using my email
address in the from (not spoofing). IIS is relaying the mail to our internal
exchange server, however when this mail arrives in hotmail it automtically
goes to the junk folder. If I try sending the same email from my outlook
account it goes into the inbox. Why does this happen and is there anyway
around it?
--
John Tag: Is CLR a process or a thread? Tag: 81970
ANN: NLog - a .NET Togging Tool v0.2 beta 1 has been released
NLog 0.2-beta1 has been released and can be downloaded at:
http://nlog.sourceforge.net/.
NLog is a .NET logging library similar in concepts to log4net, designed with
simplicity and flexibility in mind. It supports the base concepts of log4net
(appenders, layouts, filters) and makes them easy to use in your
application.
Features:
- ease of use (uses familiar WriteLine() style interface)
- maintainability (trivial to configure and re-configure)
- speed (uses "zero allocations" principle whenever possible), no-logging
situations are detected really quickly
- binary portability (.NET, Mono, .NET CF) - use a 'portable dll' or a
'compact dll'
- not over-patterned - it just does logging
- easy to migrate from log4net
If you find log4net too difficult to configure and use effectively or simply
too java-ish then NLog might be the tool for you. It's open source released
under BSD license.
See http://nlog.sf.net/ for more information.
To subscribe to the NLog mailing list visit:
http://lists.sourceforge.net/mailman/listinfo/nlog-list
Regards,
Jarek Tag: Is CLR a process or a thread? Tag: 81968
how to see in the registry if Framework 1.1 SP1 is installed
Hi,
How can I see in the registry if the .NET Framework 1.1 Service Pack 1 is
isntalled? It seems to me that
"SOFTWARE\Microsoft\NET Framework Setup\NDP\v1.1.4322\SP" should have the
value "1" when it is isntalled? Am i right?
Thanks,
Pieter Tag: Is CLR a process or a thread? Tag: 81959
when installing Framework SP1 on Developper pc and Client pc's?
Hi,
I guess it's always a good thing to install a SP. So I would like to install
the Framework 1.1 SP1 to my development-pc, and also on my client's pc's.
Although, I don't knwo if this would affect the software
(VB.NET-applications). and I'm not able to find any informationabout this
:-(
- Can I install SP1 on my pc's, build VB.NEt applications, end deploy them
on pc's without SP1?
- Can SP1-pc's run without any problem software build on a
non-SP1-development-pc?
- Should software be build on SP1, and than deployed on SP1?
Any help about this issue would be really appreciated!
Thanks a lot in advance!
Pieter Tag: Is CLR a process or a thread? Tag: 81958
System.Net.Dns.GetHostByAddress returns incorrect Hostame
Hi!
I have a problem with
System.Net.Dns.GetHostByAddress(ls_Request.UserHostAddress()).HostName
Usually the call GetHostByAddress returns the correct hostname of the
client, but sometimes I get a hostname like _CERDR1342B88E.
Why? The clients are running under Windows CE.NET 4.1...
Sven Tag: Is CLR a process or a thread? Tag: 81956
Directly deriving from MulticastDelegate
Hello All,
It is possible with C#? If not, anyway to define my own event
accessor methods as in MC++?
Best regards,
Paul. Tag: Is CLR a process or a thread? Tag: 81952
trying to pass Request.QueryString as input parameter
I am trying to pass an input parater to SQL Server. The parameter is a URL
querystring variable. I can't seem to get it to pass a variable, only a
literal value...
Help!
In the following example, the @archiveType parameter accepts the "all"
sample value. If I replace "all" with Request.QueryString("archiveType"),
it doesn't work. What am I doing wrong?
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "[myProcedure]"
Me.SqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
Me.SqlSelectCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
Me.SqlSelectCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@archiveType",
System.Data.SqlDbType.VarChar, 5, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, "all"))
---------------------------------
Here's the procedure:
CREATE PROCEDURE myProcedure
@archiveType varchar(5)
as
SELECT col1
FROM table1
WHERE col1 = @archiveType
--
_____
DC G Tag: Is CLR a process or a thread? Tag: 81951
Event Log Class Problem
hi all. my problem is like this: i'm fetching a security event log
messege(Local Computer/DC) ID number 566 into an EntryWrittenEventArgs
Object. but when i'm reading the Messege Property, i'm getting %{SomeGuid}
instead of the actual information, in the String. i need to search for the
Object name from inside the Messege,(a DN of an object) but instead i'm
reading those Replacement Strings Instead... i must mention that i'm seeing
this problem in event 566 specificlly. on other events like event 560, the
information is written correctly. in the Reguler event log viewer, the
messege appear correctly. any help will be appreciated.
--
Omer Maydan
MCSE,Security+ Tag: Is CLR a process or a thread? Tag: 81950
C# equivalent of the /fx C++ compiler option
Hello All,
Is there any equivalent to the /fx C++ compiler option
for C#?
Best regards,
Pau. Tag: Is CLR a process or a thread? Tag: 81948
"Overloading" delegate
Hello,
What is the best way to have something like this?
protected delegate string CalculationDelegate(int count);
protected delegate string CalculationDelegate(double count);
Best regards,
Paul. Tag: Is CLR a process or a thread? Tag: 81947
Memory Manage in pInvoke
hi..
Thanks for reading my msg...
I am using pInvoke services in my application to call functions from an
external DLL. Here I like to know about memory management in pInvoke, b'se i
m calling no of functions from the same DLL. I know like.. the
IUnknown.release() will release the dll object when it's reference counter
reach zero.. but i want a clear idea abt this. if you have any idea/related
web url, plz. give me a hand...
example of using external dll...
[DllImport ("myDll")]
public static extern void myFunction1();
[DllImport ("myDll")]
public static extern void myFunction2();
bye
-rajaManickam Tag: Is CLR a process or a thread? Tag: 81946
Compile warning???
Hi
When i compile my app i get the following warning... not sure how to get rid
of it. I have removed and added my 'Reference' back in but it didn't change
anything.
Warning: The dependency 'MyDLL, Version=1.0.1672.16368, Culture=neutral' in
project 'MyApp' cannot be copied to the run directory because it would
overwrite the reference 'MyDLL, Version=1.0.1706.30700, Culture=neutral'.
Regards
Darryn Tag: Is CLR a process or a thread? Tag: 81936
Monitor.Wait/Monitor.Pulse
I just want to be clear on this....
If a threadA performs a Monitor.Pulse(lockobject),
but threadB has not yet entered Monitor.Wait(lockobject), when threadB
finally gets around to doing its Monitor.Wait(lockobject) it is
possible that it will wait forever if not pulsed again, yes?
The description of how Wait works strongly imply this since the
Pulse only readies threads in the lockobject's waitlist and since
threadB isn't on it (yet) it will completely miss the pulse.
This isn't explicitely stated anywhere I can find.
Is my understanding correct?
Oz
--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail? Tag: Is CLR a process or a thread? Tag: 81932
Can a MdiParent recieve ActiveMdiChild events?
I want my MdiParent to react to a public MdiChild event. Is there a
way to accomplish this?
Thanks
Bob Tag: Is CLR a process or a thread? Tag: 81930
CLI 3 Standard and TryParse
Hello:
I'm starting a solution with Visual Studio .NET 2005 Beta 1 one of its
projects (the bussines logic) must use only the standar types/members of a
CLI Standard Library implementation, because it's intended to be compiled on
any implementation of the Common Language Infrastructure, not only on the
.NET Framework.
The problem is that I don't know if I can use the TryParse methods of the
base types, since there is not even a working draft of the CLI 3 Standar (but
I've seen one of the C# 2 Standar).
Will the TryParse methods be standarized? I think they should, in fact, I
think that if you had to choose between standarizing Parse or TryParse, it
would be better to remove Parse and only standarize TryParse. If you want to
implement a Parse method you could always do this:
public int Parse(string s)
{
int result;
if (!int.TryParse(s, out result))
throw new FormatException("The specified string is not a valid
number.");
return result;
}
But figure out you only want to check if a string has a valid numeric
format, and you can only use Parse because TryParse is not standarized: this
case you have to catch an exception:
public bool IsValidInt32(string s)
{
try { int.Parse(s); }
catch (FormatException) { return false; }
return true;
}
And you know it's not a recommended programming technique to expect and
catch exceptions for value-checking purposes.
In conclusion: I would appreciate if some guy of the BCL team at Microsoft
could tell me if TryParse will be in the standard, and if not, I suggest it.
And also I would like to know how long will the new version of the standard
take to be released.
Thank you very much in advance, and sorry for my bad english, it's not my
native language.
Again, thank you.
Samuel. Tag: Is CLR a process or a thread? Tag: 81928
Hey! what wrong with the damn .net framework 1.1 sp1 for w2k3?!
my iis 6 was alright
but after installed .net 1.1 sp1 from windows update, it down!!!!
after rebooted, always "Server is too busy" !!!!!!! untill now!!!!!
What wrong with this nuts thing?!!
d*mn!!!!!
(The full comment of the error:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=683665
) Tag: Is CLR a process or a thread? Tag: 81922
How do you extract images from video files in .NET?
I'm trying to write a program that can extract arbitrary frames into bitmaps
from video files like avi's, wmv's, mpg's, etc. and I'm trying to write it
in .NET. I looked at the managed DirectX9 SDK but all I could find was an
unmanaged C++ sample that I used DirectShow which doesn't appear to have a
managed API. (
DX90SDK\Samples\C++\DirectShow\Editing\GrabBitmaps\GrabBitmaps )
Basically, the only thing I have less experience with than C++ is with
DirectX, but I'm pretty good with C# and the Framework. I'm a little lost on
this, so any guidance would be very apreciated.
TIA// Tag: Is CLR a process or a thread? Tag: 81921
Hor to Receive EMail?
Can I use dotNet framework class library to receive POP3 EMail? I hope there
is a namespace like System.Web.Mail that can help me to do the job more
easily. But I can't find that? Is there any one can help me? Thanks! Tag: Is CLR a process or a thread? Tag: 81914
Directory.Exists(path) creates a directory
I"m using this method to determine if a folder\directory exists:
Directory.Exists(path)
and as I call it, it creates (by itself - even though the folder doesn't
exists) a new folder according to tha path I passed it and returns 'true'!
How could that be? Tag: Is CLR a process or a thread? Tag: 81908
Problem with Visual Studio
View this article only
Newsgroups:microsoft.public.dotnet.languages.csharp
Data:2004-09-02 10:22:57 PST
In article <bc42e1a.0409020904.7823513a@posting.google.com>,
bernardpace@yahoo.com says...
> Hi,
>
> I'm not sure if this is the correct group were I should have posted
> this message. So sorry for any problems created.
>
> I am currently using Visual Studio .Net 2003. When I do as follows
> the following error is being given.
>
> File->New->Project, and then I choose Visual C# Projects and a
> Windows application. I give the name and location and press OK. The
> following error is being given "ClassFactory cannot supply requested
> class". I have also tried to create a Console application instead of
> windows application, but the same problem persists. The same problem
> is given also when trying another programming language such as C++.
>
> The problem seems to have started after I have installed Service
> Pack 2 for Windows XP.
>
> Can someone give help about my problem and how to fix it.
Have you tried running the "Repair" option on VS.NET?
--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Ibghat messagg biex isegwi lil dan
Messaġġ numru 3 fil-fil
Minn:Xarky (bernardpace@yahoo.com)
Suggett:Re: Problem with Visual Studio
View this article only
Newsgroups:microsoft.public.dotnet.languages.csharp
Data:2004-09-02 23:15:30 PST
Patrick Steele [MVP] <patrick@mvps.org> wrote in message news:<MPG.1ba1209333e24bcf98968c@msnews.microsoft.com>...
> In article <bc42e1a.0409020904.7823513a@posting.google.com>,
> bernardpace@yahoo.com says...
> > Hi,
> >
> > I'm not sure if this is the correct group were I should have posted
> > this message. So sorry for any problems created.
> >
> > I am currently using Visual Studio .Net 2003. When I do as follows
> > the following error is being given.
> >
> > File->New->Project, and then I choose Visual C# Projects and a
> > Windows application. I give the name and location and press OK. The
> > following error is being given "ClassFactory cannot supply requested
> > class". I have also tried to create a Console application instead of
> > windows application, but the same problem persists. The same problem
> > is given also when trying another programming language such as C++.
> >
> > The problem seems to have started after I have installed Service
> > Pack 2 for Windows XP.
> >
> > Can someone give help about my problem and how to fix it.
>
> Have you tried running the "Repair" option on VS.NET?
Sorry for my ignorance. Can you please tell me where the Repair
option is because I can't find it.
Ibghat messagg biex isegwi lil dan
Messaġġ numru 4 fil-fil
Minn:Patrick Steele [MVP] (patrick@mvps.org)
Suggett:Re: Problem with Visual Studio
View this article only
Newsgroups:microsoft.public.dotnet.languages.csharp
Data:2004-09-03 08:40:28 PST
In article <bc42e1a.0409022215.2c91fd70@posting.google.com>,
bernardpace@yahoo.com says...
> Sorry for my ignorance. Can you please tell me where the Repair
> option is because I can't find it.
Go to Control Panel
Add/Remove Programs
Select Microsoft VS.NET 2003 ...
Click Change/Remove
On the screen that pops up, pick option 2
The click the Repair/Reinstall button
--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Ibghat messagg biex isegwi lil dan
Messaġġ numru 5 fil-fil
Minn:Xarky (bernardpace@yahoo.com)
Suggett:Re: Problem with Visual Studio
View this article only
Newsgroups:microsoft.public.dotnet.languages.csharp
Data:2004-09-04 05:48:21 PST
Patrick Steele [MVP] <patrick@mvps.org> wrote in message news:<MPG.1ba259cc23089f5898968e@msnews.microsoft.com>...
> In article <bc42e1a.0409022215.2c91fd70@posting.google.com>,
> bernardpace@yahoo.com says...
> > Sorry for my ignorance. Can you please tell me where the Repair
> > option is because I can't find it.
>
> Go to Control Panel
> Add/Remove Programs
> Select Microsoft VS.NET 2003 ...
> Click Change/Remove
> On the screen that pops up, pick option 2
> The click the Repair/Reinstall button
A complete Repair was done. No errors were reported. A new project
was tried to be started, but the problem persisted.
What else can be done to fix the problem? Tag: Is CLR a process or a thread? Tag: 81907
JulianCalendar formatting + parsing difficulties
I'm implementing a program dealing with astronomic phenomena and need to use
Julian Calendar dates (for dates before the Gregorian Calendar changeover). I
can use the JulianCalendar class to convert dates to and from the Julian
Calendar, but I'm unable to use any of the built-in DateTime formatting or
parsing routines because the JulianCalendar is not an "OptionalCalendar" for
any culture.
I've looked through the Framework documentation extensively, but see no way
around this "calendar lockout".
Does anyone know the basis for this limitation or how to work around it
without re-implementing the entire DateTime formatting and parsing engine for
this one calendar (which obviously seems like a completely wrong-headed
approach)?
Thanks, in advance.
- Roy Ivy Tag: Is CLR a process or a thread? Tag: 81906
Is CLR a process or a thread?
If it's a process, what's the name? If it's a thread, what's the name of its
parent process?