Getting Read/Delivery receipts from SMTPClient mail message?
I'm trying to get a Delivery Receipt from sending a message using the
System.Net.Mail.SMTPClient Class
There seems to be a few ways to do it. You can set the
DeliveryNotificationOptions, or add Headers.
I've tried the following with varying results.
eMail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess
eMail.Headers.Add("Disposition-Notification-To", """" & sEmail_Sender_Name &
""" <" & sEmail_From & ">")
eMail.Headers.Add("Return-Receipt-To", """" & sEmail_Sender_Name & """ <" &
sEmail_From & ">")
I cannot seem to get a receipt for HTML Messages that I send to my Yahoo
Account. The Messages get through fine. I can see the headers and they
look fine too. If I send the message to my local Exchange Server, the
receipts work great.
If I just use the .body to send a Text email, I am able to get a Delivery
Receipt for the Text Message.
Here is how I've Formatted the HTML Message.
Dim htmlType As System.Net.Mime.ContentType = New
System.Net.Mime.ContentType("text/html")
eMail.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(bcEmail_HTML_Body,
htmlType))
Any Suggestions?
Thanks,
Scott<- Tag: Windows Installer Tag: 107621
VB 2005 Express Collection(of T) IComparator
In the code below, the IComparator function is never called. What am I
missing?
Public Class ArchiveInfo
Implements System.IComparable(Of ArchiveInfo)
Public FullName As String = ""
Public AccountNumber As String = ""
Public Sub New(ByRef Account As String, ByVal fname As String)
AccountNumber = Trim$(Account)
FullName = Trim$(fname)
End Sub
Public Function CompareTo(ByVal other As ArchiveInfo) As Integer
Implements System.IComparable(Of ArchiveInfo).CompareTo
Dim aiPath As String
Dim mePath As String
Dim i As Integer
i = InStr(other.FullName, "\archives\")
If i = 0 Then aiPath = other.FullName Else aiPath =
Mid$(other.FullName, i + Len("\archives\") + 1)
i = InStr(FullName, "\archives\")
If i = 0 Then mePath = FullName Else mePath = Mid$(FullName, i +
Len("\archives\") + 1)
Return aiPath.CompareTo(mePath)
End Function
End Class
Calling code:
dim Results as new Collection(of ArchiveInfo)
...
dim ai as new ArchiveInfo(someaccount, filename)
if not results.contains(ai) then results.add(ai)
===============
I understand that if results.count = 0 then the call shouldn't be made.
However, a breakpoint on the ArchiveInfo.CompareTo function is never
triggered. Tag: Windows Installer Tag: 107619
customize drawing tool with messenger API?
The MSN Messenger drawing tool is great, but kind of limited.
Would there be a way to make a customized messenger using the API
with a more full featured drawing tool?
As is the drawing tool only has the most basic functions and only lets
you drag drawings from another instance of messanger.
I am looking for features you might find in Word, or even Illustrator /
CorelDRAW / Photoshop - select all, group objects, drag an object or
selected objects to a different spot on the drawing, ability to
cut/paste from other programs (a Word drawing or a drawing in an saved
messenger conversation (RTF file), or even a bitmap from Paint. Maybe
paint bucket fill or a line drawing tool, or shapes (rectangle, oval,
etc).
Has anyone made anything like this?
Any idea how to do this?
(also, a way to send someone your own user-created flash animation,
like the Winks, and for the person receiving to save it to a flash file
that they can play back later) Tag: Windows Installer Tag: 107615
Error loading design screen for an Inherited form
I am using MDE 2003 version 7.1.3088 with .NET Framework 1.1. I have a C#
program with a Windows Form I want to inherit from. When I create the
inherited class I get an error when I try to go to the design screen. It
says that there was an exception trying to get an instance of the base
class. The exception is "Object reference not set to an instance of an
object". How can I find out where in the base class this is happening.
What do I do? If I run the program and bring up the inherited form it works
fine....I just can't open it in the design window to change whats on the
screen. My goal is to add controls to the new screen that weren't on the
original one.
Brandon Tag: Windows Installer Tag: 107612
Programattically Change Password
Hello.
I need to programmatically reset a user's password. We will create an
account that has the proper authority to do so.
I've been looking through the .Net framework for a class that might handle
this but am having no luck.
Does anyone have any suggestions?
Thanks in advance,
Mike Tag: Windows Installer Tag: 107609
IIS and .Net 2.0
I have three web site on one Windows 2003 server. I tried to configure one to
use the 2.0 framework. That doesn't work. The error message I got is that
multiple web site can't use the same process to run different version of the
framework. Next I create a new application pool. I thoght I could move one
website into a separate application pool.
How can I move a web site into a separate process? Tag: Windows Installer Tag: 107607
Detecting if a remoted object really exists
Hi,
is there a chance to find out if a proxy to a remote object is dead without
calling a method on the proxy? I have written a frontend for a service, the
service itself is the remote object. When I first start my frontend
everything works as expected, the call to Activator.GetObject() returns
null. But when I start the service and the stop it again calling
Activator.GetObject() returns me a TransparentProxy. Any ideas?
Regards,
Michael Tag: Windows Installer Tag: 107599
Directory of assembly when using services
Hi all,
normally, when starting a service the current directory
(System.Environment.CurrentDirectory) is the system directory of the
platform. The service itself can be started from another location e.g.
c:\foo\bar\myservice.exe . Is there a way to get the directory the service
executable was started from, in my example c:\foo\bar\?
Kind regards and thanks for your help in advance,
Michael Tag: Windows Installer Tag: 107586
Detecting file changes just like Visual Studio
I want to mimic the functionality of Visual studio where if an opened
file is modified outside of the IDE, the user is prompted if they wish
to reload the file(s). What is the best approach to do this. I have
read different postings about the FileSystemWatcher class where there
seems to be plenty of problems and hacks required when using this class
(e.g. duplicate notifications) etc.
What should I use - FileSystemWatcher or some alternative ?
thanks,
Des. Tag: Windows Installer Tag: 107585
Remote Netwrok Connection to be created
Hi everybody,
How would I create a class to simulate a network connection to a remote
server via Internet using tcp\ip? I would used this connection to access a
remote sql server. Similar to using TCPClient and TCPListener on a local
network with socket
Thanks.
den2005
--
MCP Year 2005, Philippines Tag: Windows Installer Tag: 107584
File preview in Windows Forms application
Hello
I am creating a small C#.NET 1.1 Windows Forms application, which looks up
power point files in a target directory. Now, what I wanted to do was have a
preview of the 1st slide of the powerpoint file in a small area of the
window. Is this possible? If you want to see what I mean, in windows xp, if
you open windows explorer and go to a directory with power point files, in
the left pane you should see some panels ("File and Folder Tasks", "Other
places" and "Details"). If the details panel doesn't show anything, clikc on
the downward arrow beside it and it should expand. After doing so, select a
power point file and in the Details panel in the left navigation pane you
should see the first slide of the power point presenation that you selected
along with the name of the file, the type of file, data modified, size, etc.
Please make sure that you have the "Folders" button at the toolbar de-pressed
so that you see the panels in the left pane as I am describing and not the
file tree view.
Thanks,
--
Ruepen Tag: Windows Installer Tag: 107569
.NET Framework 1.1 SP1 problem under ASP.NET.
I have an ASP.NET application that makes a TCP remoting call to a managed
C++ application through a managed C++ DLL. Everything has worked fine for
some time now up until I have installed SP1. Now, what happens is that the
remoting call fails if I copy any updated assembly DLL to the ASP.NET web
site. It even happens if I update web.config. The only way to fix the
problem is to restart IIS. This did not happen before applying SP1 to .NET
1.1.
Does anyone know of this problem and if there is a fix?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
EmailID = varnk
Domain = Diebold.com
----------------------------------- Tag: Windows Installer Tag: 107559
how to determine whether a datarow is null or not
Dear sir,
I am trying to find a row in a dataset. I know I can define a primaryKey and
use rows.find(key) to locate this row.
However, very often this row does not exists, what can I use to determine
whether this row exists or not??
>Dim objSet As New DataSet
>objSet.ReadXmlSchema("e:\abc\test.xsd")
>objSet.ReadXml("e:\abc\test.xml")
>objSet.Tables(0).PrimaryKey = New DataColumn() {objSet.Tables(0).
Columns("GroupId")}
>Dim datarow As DataRow = objSet.Tables(0).Rows.Find(9)
Now I need to determine whether it finds the row with key=9 or not? How can
I do it?
regards,
Guoqi Zheng
http://www.ureader.com Tag: Windows Installer Tag: 107553
Deploying a winform in 2.0 Framework on the intranet
There should be a way to distribute a winform from a URL on the intranet.
Where can I find more information on this subject? Tag: Windows Installer Tag: 107549
Using System.Xml.XmlDocument to parse an XML Excel document
I am loading an xml excel document into the XmlDocument class, and using the
SelectSingleNode method to try and select the node of the Worksheet in the
document. It is not returning any results, but my XPath is right as far as I
can tell.
This is my code:
xmlDoc.Load( "Export\\antivirus.xml" );
XmlNode original = null;
original = xmlDoc.SelectSingleNode( "/Workbook/Worksheet" );
worksheet = original.Clone();
But no node is returned and original is null. Am I doing something wrong?
Here is a copy of the xml being loaded:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Chris Balmer</Author>
<LastAuthor>Chris Balmer</LastAuthor>
<LastPrinted>2005-11-28T14:21:24Z</LastPrinted>
<Created>2005-11-28T14:15:25Z</Created>
<Company>SMW Automotive</Company>
<Version>11.6568</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>12015</WindowHeight>
<WindowWidth>17115</WindowWidth>
<WindowTopX>360</WindowTopX>
<WindowTopY>120</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s21">
<Font x:Family="Swiss" ss:Size="18" ss:Bold="1"/>
</Style>
<Style ss:ID="s22">
<Font x:Family="Swiss" ss:Size="14" ss:Italic="1"/>
</Style>
<Style ss:ID="s23">
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
</Borders>
<Font x:Family="Swiss" ss:Size="12"/>
</Style>
</Styles>
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="5" x:FullColumns="1"
x:FullRows="1">
<Column ss:AutoFitWidth="0" ss:Width="178.5"/>
<Column ss:AutoFitWidth="0" ss:Width="78"/>
<Row ss:AutoFitHeight="0" ss:Height="23.25">
<Cell ss:StyleID="s21"><Data ss:Type="String">Antivirus
Audit</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="18.75">
<Cell ss:StyleID="s22"><Data ss:Type="String">Location</Data></Cell>
</Row>
<Row ss:Index="4" ss:AutoFitHeight="0" ss:Height="15.75">
<Cell ss:StyleID="s23"><Data ss:Type="String">Computer</Data></Cell>
<Cell ss:StyleID="s23"><Data ss:Type="String">Date</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">Test</Data></Cell>
<Cell><Data ss:Type="String">Test</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Print>
<ValidPrinterInfo/>
<HorizontalResolution>600</HorizontalResolution>
<VerticalResolution>600</VerticalResolution>
</Print>
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>3</ActiveRow>
<ActiveCol>2</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
Can anyone help me figure out how to get the Worksheet node without using
static numbers (i.e. XmlDocument.ChildNodes[2])?
Thanks,
Chris Tag: Windows Installer Tag: 107547
Difficulty with Remoting and IPC Channels
I'm trying to get an Remoting proof of concept working. Using TCP and/or
HTTP Channels, the proof of concept works fine. However, when trying it with
the IPC Channel, I get the following RemotingException when exectuing the
client piece:
"Failed to connect to an IPC port: Access Denied"
I can't seem to find any useful info regarding this error message and what
it means exactly. Any ideas? Tag: Windows Installer Tag: 107546
confusion working with setup project?
Hi,
I have a VB.NET 2003 project framework 1.1.4.
I would like to create a setup project with the following structure for the
final
installation when the setup.msi is run.
C:\program files\company name\progname (this I have completed)
the the programe name directory I would like to have the exe file, the
app.config, and 3 text files that I have containing other config data.
then in the bin directory all the dependency assemblies(dlls).
The problem:
When I am debugging the application the 3 text files are'nt found unless
they are in the bin directory of the project. I am using
Application.StartupPath to find the text files. They are only found when they
are in the bin directory where I don't want them to be. The debug .exe is
created in the bin directory which I thinks explains some of this.
Also, when I make the setup.msi file and run it, the dependency files in the
bin are not found by the exe application which is in the root. If I copy the
dendencies from the bin into the root, it works fine.
the only way I can get it to work is all the text files and dependency dlls
in the same directory on the root.
I want the dependencies in the bin, the text files in the root, the exe in
the root, and the app.config in the root.
I've messed around for hours and cant' get this.
please advise.
thanks
Chris Tag: Windows Installer Tag: 107543
Connecting to strong-named DLL outside of appbase
Hi again,
I'm working on an app that will be using an assembly that will be
sitting on the network. I thought once I got the public key from the
assembly I'd have it figured out, but alas, I don't. Any help would be
appreciated. (And sorry in advance for a long message)
Here's my setup:
The application (DBAuthTest.exe) is sitting in a directory, the DLL
(DBAuth.dll) is in another directory (not a subdirectory of where
DBAuthTest.exe is).
In the directory with DBAuthTest.exe, I have DBAuthTest.exe.config,
which contains:
-------------snip---------------
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DBAuth"
publicKeyToken="c7d47cb0d27711c5"
culture="neutral" />
<codeBase version="1.1.1.1"
href="file:///c:/dllpath/DBAuth.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
--------------snip-------------
When I execute DBAuthTest.exe, I get an uncaught exception, here's the
results from that window:
-------------begin----------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly
'DBAuth, Version=1.1.1.1, Culture=neutral, PublicKeyToken=null' or one
of its dependencies. The system cannot find the file specified.
File name: 'DBAuth, Version=1.1.1.1, Culture=neutral,
PublicKeyToken=null'
at DBAuthTest.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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)
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Documents and
Settings\me\Desktop\dbauthtest\DBAuthTest.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = myshop.COM\me
LOG: DisplayName = DBAuth, Version=1.1.1.1, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/me/Desktop/dbauthtest/
LOG: Initial PrivatePath = NULL
Calling assembly : DBAuthTest, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and
Settings\me\Desktop\dbauthtest\DBAuthTest.exe.config
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Documents and
Settings/me/Desktop/dbauthtest/DBAuth.DLL.
LOG: Attempting download of new URL file:///C:/Documents and
Settings/me/Desktop/dbauthtest/DBAuth/DBAuth.DLL.
LOG: Attempting download of new URL file:///C:/Documents and
Settings/me/Desktop/dbauthtest/DBAuth.EXE.
LOG: Attempting download of new URL file:///C:/Documents and
Settings/me/Desktop/dbauthtest/DBAuth/DBAuth.EXE.
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
DBAuthTest
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase:
file:///C:/Documents%20and%20Settings/me/Desktop/dbauthtest/DBAuthTest.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
-------------end----------------
Funny thing is, when I remove the publickeytoken item from the config
file, it looks like it actually finds the DLL file, just chokes on the
public key not being right. Here's the difference in the error message
from when that happens.
-------------begin----------------
=== Pre-bind state information ===
LOG: User = myshop.COM\me
LOG: DisplayName = DBAuth, Version=1.1.1.1, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/me/Desktop/dbauthtest/
LOG: Initial PrivatePath = NULL
Calling assembly : DBAuthTest, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and
Settings\me\Desktop\dbauthtest\DBAuthTest.exe.config
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///c:/dllpath/DBAuth.dll.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY
TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing
terminated.
-------------end----------------
It's odd that it attempts to download the dll when there's no public
key specified in the config file, but seems to ignore the config file
(or the dll) when the public key token is specified.
Any help or point in the right direction would be, again, greatly
appreciated.
Thanks,
Mike Tag: Windows Installer Tag: 107541
Play and Play application
Hello Everyone:
I have and existing client/ server application that is written in .Net. I
recently got a requirement that we need to design a all future modules is
such a way that the user can choose to install a module of the application.
I wanted to know if there are patterns that can help me accheive this.
Thanks
PRaveen Tag: Windows Installer Tag: 107540
Generic Union Type with Explicit Layout
I am desperately trying to build a generic union type with explicit field
layout. First, I will show you my attempt without generics. This is something
like a tagged union in functional languages like F#. Thus let us first write
an example using F#, which is rather short (assuming polymorphic types 'T
stack and 'T queue already defined)
---
type 'T ProcessingOrder = Stack of 'T stack | Queue of 'T queue;;
---
This defines the generic type ProcessingOrder to be either a stack or a
queue, with explicit tags Stack and Queue. 'T is the type parameter. As I
have found out using IL DASM, F# circumvents my problem by using auto layout
and thus does not create a real union type, wasting space.
Let me define the same type using C#:
---
[StructLayout(LayoutKind.Explicit)]
struct ProcessingOrder<T>
{
[FieldOffset(0)] public readonly object _object;
[FieldOffset(0)] public Stack<T> _stack;
[FieldOffset(0)] public Queue<T> _queue;
}
---
Note that I use implicit tagging, as classes in .NET are already tagged. One
may explore the actual type of the union by typeof(_object). Propably not the
fastest way.
Unfortunately, this does not work. Compiles without error messages but at
execution a TypeLoadException is thrown, which tells me that explicit layout
is not allowed for generic types.
Au contraire, a specialized implementation works fine:
---
[StructLayout(LayoutKind.Explicit)]
struct ProcessingOrderInt
{
[FieldOffset(0)] public readonly object _object;
[FieldOffset(0)] public Stack<int> _stack;
[FieldOffset(0)] public Queue<int> _queue;
}
---
Has anyone an idea why explicit layout is forbidden for generic types? Has
anyone an idea how to circumvent this without accouting space for every
choice?
TIA,
Hagen Tag: Windows Installer Tag: 107537
EventHandling problem : Java has solution but what about Microsoft???
This is a multi-part message in MIME format.
------=_NextPart_000_0021_01C5F52E.1C9DEDE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I have added few of the events in some control, example code is:
btnControl.GotFocus +=3Dnew EventHandler(EventHandlingMethod);
btnControl.Click +=3Dnew EventHandler(EventHandlingMethod);
lblControl.Click +=3Dnew EventHandler(EventHandlingMethod);
private void EventHandlingMethod(object sender, EventArgs e)
{
.......
}
btnControl =3D Button object, lblControl =3D Lable object
Now the problem is: I am adding the same event handler method in all =
events for btnControl and lblControl too.
now in EventHandlingMethod method, i can find which control is using =
sender but now if i want to put some switch cases in the method for =
Event Name then I have no any such information in the eventargs or =
anyother way....
Can someone help/guide me to get the event name?
Is it possible? if yes then how? If no, then any work around?
Thanks in Advance
Regards,
Mahesh Devjibhai Dhola
------=_NextPart_000_0021_01C5F52E.1C9DEDE0
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.1522" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have added few of the events in some =
control,=20
example code is:</FONT></DIV>
<DIV>
<P><FONT face=3DArial color=3D#0000ff size=3D2><EM>btnControl.GotFocus =
+=3Dnew=20
EventHandler(EventHandlingMethod);<BR>btnControl.Click +=3Dnew=20
EventHandler(EventHandlingMethod);<BR>lblControl.Click +=3Dnew=20
EventHandler(EventHandlingMethod);</EM></FONT></P>
<P><FONT face=3DArial color=3D#0000ff size=3D2><EM>private void=20
EventHandlingMethod(object sender, EventArgs =
e)<BR>{<BR> =20
.......<BR>}</EM></FONT></P>
<P><EM><FONT face=3DArial color=3D#0000ff size=3D2>btnControl =3D Button =
object,=20
lblControl =3D Lable object</FONT></EM></P>
<P><FONT face=3DArial size=3D2><EM><FONT color=3D#0000ff>Now</FONT></EM> =
the problem=20
is: I am adding the same event handler method in all events for =
btnControl and=20
lblControl too.</FONT></P>
<P><FONT face=3DArial size=3D2>now in EventHandlingMethod method, i can =
find which=20
control is using sender but now if i want to put some switch cases in =
the method=20
for Event Name then I have no any such information in the eventargs or =
anyother=20
way....</FONT></P>
<P><FONT face=3DArial size=3D2>Can someone help/guide me to get the =
event=20
name?</FONT></P>
<P><FONT face=3DArial size=3D2>Is it possible? if yes then how? If =
no, then any=20
work around?</FONT></P>
<P><FONT face=3DArial size=3D2>Thanks in Advance</FONT></P>
<P><FONT face=3DArial size=3D2>Regards,<BR>Mahesh Devjibhai=20
Dhola</FONT></P></DIV></BODY></HTML>
------=_NextPart_000_0021_01C5F52E.1C9DEDE0-- Tag: Windows Installer Tag: 107532
What is the .NET equivalent of Java's MANIFEST.MF and co.?
I'm trying to understand where the information in the META.INF directory
including MANIFEST.MF etc is to be found for .NET assemblies.
Also some projects such as Eclipse's OSGi kernel stores additional info in
the MANIFEST.MF file. What would be the .NET equivalent where such info can
be stored?
Kunle
--
Don't talk unless you can improve the silence. Tag: Windows Installer Tag: 107531
Finding a DLL's public key value
Hi all,
I've been working on this problem for a few days and I'm about at my
whit's end for searching, I appreciate any help I can get with this.
I've got a DLL that was signed with a key (using VS 2005). I'm trying
to find the public key value to put into an application's config file
but I'm not having any luck.
Can someone point me to how to determine the key value?
Also, I have VC# 2005 Express, and I can't seem to find the fuslogvw
application to view the errors I'm getting when assemblies trying to
load. Is this something that's not included in the express editions,
or something I have to download?
Thanks for all help,
Mike Tag: Windows Installer Tag: 107525
Error using SmtpClient with local server
Hi,
I try to send a mail using System.Web.Mail.SmtpMail via the local (virtual)
SMTP server like this:
System.Net.Mail.SmtpClient smtpClient = new
System.Net.Mail.SmtpClient("localhost");
smtpClient.Credentials =
System.Net.CredentialCache.DefaultNetworkCredentials;
smtpClient.Send("test@gmx.de", "test@gmx.de", "Test", "This is as test"); //
Exception
"test@gmx.de" is an existing E-Mail-Address.
Send throws the error "Unable to relay for test@gmx.de"!???
Using the old style SmtpMail class the mail is sent without exception:
System.Web.Mail.SmtpMail.SmtpServer = "";
System.Web.Mail.SmtpMail.Send("test@gmx.de", "test@gmx.de", "Test", "This is
as test"); // OK
Does anyone know the source of this error? Tag: Windows Installer Tag: 107524
ClickOnce and updating client applications
I'm trying to understand the limitations of ClickOnce deployment, and
have a question regarding how automated client application updates can
be.
I have a server .NET application with a client application that
connects and uses .NET remoting objects in the server app. I need to
be able to deploy updates to the server and/or client, and I hope
ClickOnce will suit my deployment strategy.
My question is, if an update for the client application is available,
can the client applications that are currently connected to the server
application be automatically forced to update?
I'm concerned that ClickOnce will only prompt users to update when the
client application is restarted.
Regards
Boz Tag: Windows Installer Tag: 107521
"Cannot find assembly..." when deserializing from memorystream
I have a strange exception imo when I try to deserialize a memorystream to
an object using the following code:
public static object Clone(object sheep)
{
if (master == null)
{
throw new ArgumentNullException("sheep");
}
using (MemoryStream stream = new MemoryStream(4096))
{
object dolly = null;
BinaryFormatter formatter = new BinaryFormatter(null, new
StreamingContext(StreamingContextStates.Clone));
formatter.Serialize(stream, sheep);
stream.Seek(0, SeekOrigin.Begin);
dolly = formatter.Deserialize(stream);
return dolly;
}
}
The Exception is thrown by the formatter.Deserialize() method call: "cannot
find assembly x.dll...". For some reason the Deserialize() is trying to look
presumably in the GAC for the x.dll assembly. The object 'sheep' I am trying
to clone is in the same assembly as the utility class with the Clone()
method.
Anyone has experience this before? I am using .NET Framework v1.1.4322...
Gabriel Lozano-Morán Tag: Windows Installer Tag: 107519
Network aware application 'a la MSN'
I'm about to write a network aware application.
Of course I intend to do UDP broadcasting to detect other app on my network.
But I would like my application to be usable over the internet as well.
Between to end user computer.
Ideally if user could connect through MSN identity that would be perfect!
Is there a way to do that?
Some MSN server wrapper for .NET? Tag: Windows Installer Tag: 107512
error message on shutdown
Greetings. I am not sure if this is the group place to be asking this
question. But will do so. I have recently started the asp.net and iis in
the MyComputer/Manage/Services and Applications. Now, since starting asp.net
I get the following error message when I go to shutdown or restart my
computer. The message reads;
"The instruction at 0x0074006e referred memory at 0x0074006e. The memory
could not be "read.""
In the title bar it has;
asp.net_state exe Application error
I redid the regiis to map asp and iis together thinking this was it but it
still appears. It is during the "Shutting down Windows..." that it appears.
I am puzzled why I am getting this. Anyone have any ideas? Thanks in
advance to anyone responding.
*** John Tag: Windows Installer Tag: 107506
entering internationalized input
I have implemented an international text editor based on uniscribe, GDI &
GDI+.
While it display internationalized text fine I realize user input are no
good.
So far what I do: I override Control.OnKeyPressed(char keyCode);
I was expecting the appropriate char to be passed on.
Now I test with (very simple) french accent.
I was trying to type: 'ê' and I ended up with "[e"
So, how do I get a char which is a combination of multiple key strokes?
There must be an API for that, wouldn't it? Tag: Windows Installer Tag: 107501
lock file access
I'm using system.io.file How do I lock access to the file while appending?
Other processes may try to open it while I want it.
Thanks,
Colin. Tag: Windows Installer Tag: 107498
Access Addin
Hello,
I'm trying to develop an access addin and I'm relatively new to developing
addins for Access. Basically, I need to log certain queries that are sent to
the database. However, I can't find an event anywhere that will allow me to
see the query string.
Does anybody know how I can at least just see the query string every time
there is a query?
Thanks,
-- John Tag: Windows Installer Tag: 107492
Type switch?
I am trying to do a switch on a Type. It's actually a DataType used to
type a column in a DataTable.
I have run through several blogs and am not sure what I'm missing or
why it can't be done.
My switch statement looks like this:
int typeEnum = myObject.GetType().GetHashCode();
switch( typeEnum )
{
case ( typeof(System.Int64).GetHashCode() ) :
bool ThisIsABigInt = yes;
break;
That does not work. But this does:
string typeEnum = myObject.GetType().ToString();
switch( typeEnum )
{
case "System.Int64":
bool ThisIsABigInt = yes;
break;
The method that does this switch gets called around a zillion times,
and all of that ToString() seems like a problem.
What is the best way to simply switch on an instance Type to perform
an action? There are 30 Type tests and I don't think writing 30 if
statements is the right way to do things. Is it?
Thanks. Tag: Windows Installer Tag: 107485
vs 2003 & framework 2.0
still have vs 2003 but like to use framework 2.0 with vs 2003 instead of 1.1.
so is it possible and if it is how to register 2.0 to vs 2003? would there be
any other problems using these two together? Tag: Windows Installer Tag: 107484
Extract text from EPS-file?
Hi!
Is it possible to extract text from an EPS-file using .Net?
In this scenario, I need to process ads stored as EPS-files and extract all
text (for fulltext-indexing purposes). I looked into OCR, but that is too
expensive for this project (> 5000$).
Any help and pointers would be greatly appreciated.
Thanks in advance
Klaus Jensen, Software Developer
Agilator.dk Tag: Windows Installer Tag: 107483
Hash ContainsValue?
I have a very simple class (see CurrentUser below), that I am adding to a
hash table.
Public Class CurrentUser
Private userName As String
Private sessionId As String
Private logindateTime As DateTime
'Properties left out
End Class
I add the values:
myHash(somekey,CurrentUser)
I am implementing ICollection and everything works fine, except the
ContainsValue.
Public Function ContainsValue(ByVal value As CurrentUser) As Boolean
Return m_HashTable.ContainsValue(value)
End Function
I have also tried -
Public Function ContainsValue(ByVal value As CurrentUser) As Boolean
Return m_HashTable.ContainsValue(value.Name)
End Function
Questions:
What do I need to do to get my ContainsValue to work properly? Tag: Windows Installer Tag: 107478
attachments with MAPISendMail
hi guys,
if i call send MAPISendMail(..) in the Send routione of Mapi.Send the
attachments are convertet in text that is attached in the text part of
the mail. it is not attached as files to the mail. how can i change it
that the attachments are attached as files and not as text.
here more or less the code that i use:
Mapi ma = new Mapi();
ma.Reset();
for (..){
ma.Attach(m_strAttach[i]); //m_strAttach[i] includes the complete
path+filename of the attachment
}
ma.Send(m_strSubject,m_strText);
ma.Logoff();
thanks a lot,
elmar Tag: Windows Installer Tag: 107474
VS2005 Sync Solution Explorer w/ Active File in Text Editor
Is there a way to sync the solution explorer with the currently active file
in the text editor in VS 2005? (happened by default in 2002/3)
Thnx Tag: Windows Installer Tag: 107472
Unable to install .Net Framework 1.1 SP1
Whenever I attempt to install it it says it cannot find a .msi file in
another directory. I attempted to repair the installation but that gives me
the same type of error, cannot find specified .msi file. How do I repair
this properly? Tag: Windows Installer Tag: 107471
How to Open a File in Text-mode?
It is that in Traditional C++ ,the Class "file" has a Open Method which can
specify opening a file in Text-Mode.
The Text-Mode can automaticaly Convert "\r\n" to "\n" (\13 \10 to \10).
But,I can not find a way to do this in Extention Managed C++.Net ?
Any new Solution? Tag: Windows Installer Tag: 107470
Asynchronous WebClient
I'm trying to automate a process of logging in to a website and posting and
downloading some stuff. I am using asynchronous WebClient methods so the
user can cancel the operation at any time and it's working fine, but I have a
question about the structure of my program. Right now I've got something
like this:
Main()
{
WebClient LoginClient = new ...
// set the relevant properties and eventhandlers
LoginClient.UploadValuesAsync(...);
}
LoginClient_UploadValuesCompleted(...)
{
if(!Cancelled && !Error)
{
WebClient Page1Client = new ...
// set the relevant properties and eventhandlers
Page1Client.DownloadDataAsync(...);
}
}
Page1Client_DownloadDataCompleted(...)
{
if(!Cancelled && !Error)
{
WebClient Page2Client = new ...
// set the relevant properties and eventhandlers
Page2Client.DownloadDataAsync(...);
}
}
etc.
I've got about 5 or 6 pages I need to get and I have to get them in order,
so in each request's completed event handler I start the next request. Is
this the right way to do things? There seems to be a fair amount of repeated
code and it just feels a little strange, but it works fine.
Also, whenever I start the program and start the first request for the first
time it blocks for about a second even though it's started asynchronously.
No other requests block, even if I cancel and restart the request sequence.
If I restart the program, the first request blocks again. Is this just
because some initialization occurs in the background or something? Is there
any way to avoid this? Tag: Windows Installer Tag: 107466
FtpWebRequest in 2.0 Framework
Has anyone tried to download a mainframe file with FtpWebRequest. It doesn't
seem to translate from EBCDIC to ASCII.
The old inet control in VB6 has the same problem.
Command line FTP has no problem to translate from EBCDIC to ASCII, but I
prefer a .Net assembly. Tag: Windows Installer Tag: 107463
Wellknown-Singleton object is being created 2 times
Hi,
I have a singleton class which I want to "create" (call it's
GetInstance() for the first time)
in server process, and after some time I want to use it in client
process, through .Net Remoting.
I define the singleton as MarshalByRefObject.
My server process looks like this:
1.Register singelton type as being wellknown singleton (not
singlecall).
2. Singleton.GetInstance()
3. Console.Write("Singleton constructor called");
4. do some logic inside the singleton
5. Wait for clients to connect
Client process looks like this:
1. Register singleton type.
2. Singleton.GetInstance()
After this call, "Singleton constructor called" is being printed AGAIN
on the screen,
which means that the singleton object is being created again, and thats
not what I want.
I want to receive proxy to the same singelton, already created in
server process.
I don't understand what I do wrong.
Please help,
Mike. Tag: Windows Installer Tag: 107457
ANN: OleDBProNet for .NET version 2 is released at www.udaparts.com
Hi, All:
OleDBProNet is a .NET class library which is a complete, feature-rich,
and extremely powerful data access solution for .NET programmers through MS
OLEDB technology. It offers the following key benefits over ADO.NET:
1. Extremely simple:
OleDBProNet hides all of complexities of raw OLEDB programming. It is
written with the classical ADO data accessing model. You will never meet
BLOBs and other complicate data types conversion to bother you for all types
of SQL statements.
OleDBProNet comes with fifteen real and advanced C# and VB.NET samples
to assist your developments no matter what programming background you have.
If you have somewhat background in old ADO (Active Data Objects), you
will feel OleDBProNet is extremely simple and intuitive to use.
2. Many features available:
OleDBProNet supports all types of client and server cursors as shown in
the attached samples. It supports all of advanced rowset navigation features
(bookmark, record searching, index, bi-directional scrolling and jumping
etc) directly on server side. OleDBProNet offers much more features than
ADO.NET.
3. Super performance:
OleDBProNet is written from Visual C++ 2005 C++/CLI with direct use of
raw OLEDB interfaces, which almost eliminates data marshaling across layers
between native and managed codes completely. Also, OleDBPro uses batching
mode (20 records per batch) to retrieve and update records by default.
Generally, OleDBProNet is about five times as fast as ADO in .NET
environment. Also, OleDBProNet is about 15% faster than MS OleDB.NET
provider.
OleDBProNet can manage huge data records using server cursors, but
ADO.NET can't. Therefore, OleDBProNet is significantly faster and simpler
than ADO.NET for accessing a large number of data records.
4. Complete solution to all types of your databases:
OleDBProNet is a complete solution to all of types of databases, SQL
server, Oracle, Access, MySQL, DB2, ....... As long as you have an OLEDB
provider, or ODBC driver, or ISAM driver available, it will work for you
with one copy of code.
--
Yuancai (Charlie) Ye
Fast accessing all of remote data sources anywhere with SocketPro using
batch/queue, non-blocking and parallel computation
See 30 well-tested and real OLEDB examples
at http://www.udaparts.com Tag: Windows Installer Tag: 107456
Access file on another computer with specific username / password
I need to access files on computers around our network, some are on the same
domain as myself, and some are on others. I have an account for each domain
with rights to read files on each system, but I can't figure out how to
specify a username/password when using the System.IO namespace to read files.
Is this possible and if so, how might I accomplish the task?
Chris Tag: Windows Installer Tag: 107455
Email Sed Error
Hi,
I use the following code snippet in VS 2005
Dim message As New MailMessage("timpowell@controlequipment.co.uk",
"timpowell@controlequipment.co.uk", "Subject", "Message Text")
Dim emailClient As New SmtpClient("10.34.45.135")
emailClient.Send(message)
When I execute the code I get the below error.
System.Net.Mail.SmtpException was unhandled
Message="Failure sending mail."
Source="System"
StackTrace:
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
in C:\Documents and Settings\TPowell.CEL\Local Settings\Application
Data\Temporary Projects\WindowsApplication1\Form1.vb:line 7
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd,
Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at WindowsApplication1.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Any help would be much appreciated. Tag: Windows Installer Tag: 107454
Convert MS Word Document in HTML
I want to convert MS Word Document in HTML file.
I would like to do it, without having MS Word installed on server.
Is this possible? Tag: Windows Installer Tag: 107453
IDisposable and Finalization
I believe that I fully understand the concepts behind IDisposable and
finalization (at least I hope I do) and I would like to get feedback from the
experts so that I can forward them on to others.
There are people who think that if a class implements IDisposable then it
should include a finalizer. What I told them was that you should only
include a finalizer if you have unmanaged resources you need to ensure are
cleaned up. Otherwise you should not include a finalizer whether or not you
implement IDisposable.
As an example of this case, the one where you might want to implement
IDisposable but do not need a finalizer, I said assume you have a class that
internally makes use of a FileStream object. It might open the object up at
some point during its lifetime and keep it open from then on. In this case
you might want to implement IDisposable to provide an explicit mechanism for
the caller to indicate they are done with your class. The implementation in
your class would simply call the FileStream's IDisposable.Dispose() method.
I argue that this class does not need a finalizer and in fact if this class
did include a finalizer it would be of no use. By the time the finalizer was
called you could not do anything with your FileStream instance as it may have
already been disposed (assuming you don't expose the instance outside your
class).
Is my statement/explanations valid?
--
Thanks,
Nick Tag: Windows Installer Tag: 107452
Where's the forum for Windows Installer questions?