Why Assembly.LoadWithPartialName is obsolete?
Hello,
Does anybody know why the "Assembly.LoadWithPartialName" is obsolete?
It seems that the Load method does not have an equivalent replacement for
it.
--
Best Regards,
W. Jordan Tag: MSN chat integration Tag: 108659
framework for linux????
Hi all,
Is there a framework for linux?
Is it possible to run a .net application on a linux platform?
thank you very much
mi... Tag: MSN chat integration Tag: 108655
testing a program is running
I'm writing my installer which, of course, is a win32 app (no .NET)
I would like to test tthe program is already running (in case of
reinstall/upgrade) and prompt the user to stop the application.
How do I do that?
Basically I would like somthing like Process.GetProcessByName() but with
win32 calls.
Any idea? Tag: MSN chat integration Tag: 108654
WaitCursor / hourglass in custom printpreview dialog
Hi,
I have created a simple custom PrintPreviewDialog consisting of a simple
standard PrintPreviewControl (.NET 1.1) on a WindowsForm with a few buttons
(for printing, zooming, etc.). It is working fine, except for that I cannot
figure out how display the waitcursor / hourglass while the preview is
preparing to show the document *and then go back to the default cursor when
the document is displayed*. Turning on the waitcursor is easy, but what
event should I hook into to turn it off??
What happens when I preview a document that is about 50 pages long is that
you get the blank form on the screen and then nothing happens for maybe 40
seconds and then you get a "Generating Preview" message and then the
document is displayed. It is during the initial 40 seconds that I need an
hourglass or something to let the users know that something is happening in
the background.
Here are some snippets of what I am doing currently:
// Constructor:
public PreviewDialog(System.Drawing.Printing.PrintDocument printDocument,
int zoom)
{
InitializeComponent();
_printDocument = printDocument;
_zoom = zoom;
}
private void PreviewDialog_Load(object sender, System.EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
Initialize();
//this.Cursor = Cursors.Default; // This gets hit instantly, so you
never see an hourglass.
}
private void Initialize()
{
uxPrintPreview.Anchor = AnchorStyles.Bottom | AnchorStyles.Top |
AnchorStyles.Left | AnchorStyles.Right;
uxPrintPreview.Zoom = zoom;
this.WindowState = FormWindowState.Maximized;
uxPrintPreview.Document = printDocument1 = printDocument;
}
// The calling code:
using (PreviewDialog form = new PreviewDialog(c1Report1.Document))
{
form.ShowDialog(this);
}
If there was an event like LastPageFinished or DocumentRendered or similar
in the PrintPreviewControl, I would be home free, but I cannot find anything
like that.
Any help on this would be greatly appreciated.
Thanks,
Lars Tag: MSN chat integration Tag: 108648
Work Flow
Hi All,
Is there any open source code available for workflow engine in C#, VB .Net
framework.
Regards
- Atul Sureka Tag: MSN chat integration Tag: 108647
How to store objects created with C# in database in .NET Framework
I want to store the objects that i create in run time in database. In a way
that, for a product a create an object from a class written with C#, define
its properties and functions that it has, and want to store it in a database
(SQL Server 2K). I want the columns to be created and filled dynamically when
an object is inserted in db (Just like in J2EE, which is called i think
relational mapping, or something like this).
How can I do that? Tag: MSN chat integration Tag: 108641
How to store C# objects in DB
I want to store objects that i create programmatically in C#, like in J2EE
(which is callad i think relational mapping or sometihng like this). I want
to create objects that i use for my enterprise applications and store them in
database after execution. And I want the columns and rows related to my
objects to be created and filled automatically.
How can i do that. Thanks? Tag: MSN chat integration Tag: 108640
executable digital signature
how do i add to my executable assembly (created using VB.NET / C#) a digital
signature? Tag: MSN chat integration Tag: 108638
.NET Remoting to COM
Hello,
I have a .NET application where I want to be able to access COM objects on a
remote server (theses objects are the base for a web appliation we are
running).
I've been looking on the net for an easy example, or at the very least some
documentation that would make tell me how to do it (if at all possible). So
if anyone has any idea on how this could (or coudn't) be done, or any cue on
where to look and for what, I would strongly appreciate.
Many thank's in advance.
Eric Tag: MSN chat integration Tag: 108637
installed 2.0.50727 now I get a sql express error message
I now get the following error message after copying an asp.net application to
the deployment web server. I don't have SQLExpress or any version of SQL
2005 installed. I found the "LocalSQLServer" connection string in the
machine.config, changed that to look at a SQL 2000 database, but the error
still comes up.
An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred
while establishing a connection to the server. When connecting to SQL Server
2005, this failure may be caused by the fact that under the default settings
SQL Server does not allow remote connections. (provider: Named Pipes
Provider, error: 40 - Could not open a connection to SQL Server)
Source Error:
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): An error has occurred while establishing a
connection to the server. When connecting to SQL Server 2005, this failure
may be caused by the fact that under the default settings SQL Server does not
allow remote connections. (provider: Named Pipes Provider, error: 40 - Could
not open a connection to SQL Server)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +734995
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
Boolean& failoverDemandDone, String host, String failoverPartner, String
protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection
owningObject, Boolean aliasLookup) +820
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32
startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
+162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107
TIA,
Dave Tag: MSN chat integration Tag: 108636
mscorsvw x64 OS freeze When Idle
Hello,
I am running XP64 SP 1. I had VS2003 installed. When I tried to install
VS2005 professional my machine froze on the framework 2.0 install. I
rebooted and tried again. Same thing. I disabled my Antivirus and tried
again. Froze on the same spot.
I uninstalled VS2003 and framework 1.1, disabled my Antivirus and tried to
install framework 2.0 from the MS update website. The system froze. Once
rebooted, "Add or Remove Programs" showed that the install was complete. I
rebooted, disabled my Antivirus and then tried to install VS 2005. It
worked.
Unfortunately every time I leave my system idle for 5 to 10 minutes it
freezes up again. I opened my task manager and let it idle and every time it
freezes mscorsvw.exe is on the top of the CPU order. I did some research
and found this article.
http://blogs.msdn.com/davidnotario/archive/2005/04/27/412838.aspx
I tried the:
ngen.exe executequeueditems
It ran, reported some errors that I missed durning the scroll by and then
locked up. I have tried it again and it locks up each time at:
Executing
C:\windows\microsoft.net\framework\v2.0.0.0,culture=neutral,publictoken=b77a5c561934eo8911 /nodependencies /nologo
Least that the way I read my bad hand writing.
Any ideas on how to fix it?
Thanks in advance
Mark Tag: MSN chat integration Tag: 108634
upgrading to .NET 2.0 woes
hello ,
I'm upgrading c++ files in which the source is available that has a
managed wrapper to a non-managed dll. It was .NET 1.1 now I want .NET
2.0
I made some changes and I now get some warnings when compiling. I get
no errors.
Running this dll from my C# app returns the following exception:
{"Strong name validation failed. (Exception from HRESULT: 0x8013141A)"}
referring to the data:
{System.Collections.ListDictionaryInternal}
Now as far as I know .NET 2.0 does not contain
"System.Collections.ListDictionaryInternal". I'de like to fix my c++
file to point to the new
"System.Collections.Specialized.ListDictionary" but I can't even find
where it is trying to do this :( Searching the project for
"ListDictionary" did not return anything.
Any hints?
V. (c++ ultra-noob) Tag: MSN chat integration Tag: 108631
assembly name or one of its dependencies was not found
Hey Everyone,
I have run into a problem with asp.net
I have a web page default.aspx that posts to itself. On post, I call a
WebService to validate uername and password.
In the catch block of the WebSerive call, I am getting the attached
error. I have been researching this error for about two days and have
tried adding the ASP.NET and NETWORK SERVICE users to the administrator
group with full permissions over C:\WINDOWS and it's children as most
of the research I did pointed to that issue.
I have also installed the XMLPrecompiler solution to see if there are
any issues with serialization, but everything checks out fin there as
well.
Lastly, I verified that I was running .NET 1.1.X as some research said
that may be an issue as well. I would appreicate any help or any
suggestions.
-MW
ERROR TEXT:
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
CUSTOM METHOD DECLARATION
System.Web.Services.Protocols.SoapException: Server was unable to
process request. --> File or assembly name oaayvpwc.dll, or one of its
dependencies, was not found. at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
CUSTOM METHOD DECLARATION
Server was unable to process request. --> File or assembly name
oaayvpwc.dll, or one of its dependencies, was not found. Tag: MSN chat integration Tag: 108630
Refreshing TreeView after Editing a Label
Here's the problem. I have a TreeView that is essentially a listing of
directories and files. If you right-click on a directory then a
context menu comes up and one of the options is "New Folder", when the
user clicks that it expands the current node, creates and add's a child
node, then calls BeginEdit() on the child node.
I have written a custom class that implements IComparer to sort on
rules that I have defined. The problem comes in the fact that
BeginEdit() appears to be an async call, and as far as I can tell,
there's no event that gets fired to let me know when it is done so that
I can then call Sort() on the TreeView. There is an 'AfterLabelEdit'
event on the TreeView, but it appears that the actual label on the node
isn't changed until after that event is finished firing. I've tried
manually setting the text of the node in an event handler for that
event, but it causes the TreeView to do wierd things (like the node is
still editable after I finished editing it, and if this is the second
or so folder I've created, the previous one I create is being
reassigned the same name as the one I created. If anyone can help me,
I'd appreciate it.
Code:
================================================
private void contextMenuFolder_Click(object sender, EventArgs e)
{
TreeNode newFolder = new TreeNode("", FOLDER_CLOSED,
FOLDER_OPEN);
tvwReports.SelectedNode.Nodes.Add(newFolder);
tvwReports.SelectedNode.Expand();
CatalogItem item = new CatalogItem();
item.Type = ItemTypeEnum.Folder;
newFolder.Tag = item;
newFolder.BeginEdit();
}
private void tvwReports_BeforeLabelEdit(object sender,
NodeLabelEditEventArgs e)
{
if (e.Node.Tag != null)
{
if ((e.Node.Tag as CatalogItem).Type !=
ItemTypeEnum.Folder)
e.CancelEdit = true;
else
e.CancelEdit = false;
}
else
e.CancelEdit = true;
}
private void tvwReports_AfterLabelEdit(object sender,
NodeLabelEditEventArgs e)
{
this.Cursor = Cursors.WaitCursor;
string fullPath =
e.Node.FullPath.Substring(e.Node.FullPath.IndexOf('/'));
if ((e.Node.Tag as CatalogItem).Name == null)
{
if (e.Label == null || e.Label == "")
//this is a new folder and no name was given,
delete the node
e.Node.Remove();
else
{
//get path as relative to the webservice
fullPath += e.Label;
//new folder node, need to call webservice to add
CatalogItemManagement.CatalogItemManager.AddFolder(fullPath);
e.Node.Tag =
CatalogItemManagement.CatalogItemManager.GetCatalogItem(fullPath);
}
}
else if ((e.Node.Tag as CatalogItem).Name != e.Label)
{
if (e.Label == null || e.Label == "")
//the label was left blank, set it back to what it
was before
e.CancelEdit = true;
else
{
//node already existed, but folder name has
changed, need to update
CatalogItemManagement.CatalogItemManager.MoveCatalogItem(fullPath,
fullPath.Replace(e.Node.Text, e.Label));
}
}
this.Cursor = Cursors.Default;
}
================================================
I am using Visual Studio 2005 (with .NET 2.0, of course) Tag: MSN chat integration Tag: 108620
Nullable<int>, implementing GetHashCode, and thread safety
The VS2005 documentation for Object.GetHashCode has three notes to
implementors:
*blockquote*
If two objects of the same type represent the same value, the hash function
must return the same constant value for either object.
For the best performance, a hash function must generate a random
distribution for all input.
The hash function must return exactly the same value regardless of any
changes that are made to the object.
*/blockquote*
So in a reference type that isn't immutable satisfying the third requirement
seems to require caching the hash code the first time it's queried for. This
seems like a good place for Nullable<int>.
However, if there's a competing requirement for the reference type to be
thread-safe, the cached hash code needs to be initially assigned in a thread
safe manner. To avoid the thread safety problems with double checked locking,
there will be a locking cost associated with initially creating and caching
the hash code. To minimize the cost, and since the hash code will be
int-sized, it'd be nice to take advantage of the System.Threading.Interlocked
class's methods.
Hmm, but Interlocked.CompareExchange can't handle the following:
Nullable<int> alpha = null;
int value = 1;
Interlocked.CompareExchange(alpha,value,null);
Rats. The nullable type would have seemed cleaner, but boxing an int into an
object (below) still works.
Is this the best way to go?
How bad would the overhead of locking a private instance field and using a
nullable type be by comparison?
Is there something obvious with Nullable<int> that I'm missing that would
support this?
Should Interlocked get overrides to handle Nullable<T>?
Could such overrides avoid the same overhead that locking a private instance
field would face?
class Triple<T1, T2, T3>
{
private Object hashCode;
private T1 first;
private T2 second;
private T3 third;
//...
public override int GetHashCode(){
if (this.hashCode == null){
int firstHash = (!Object.ReferenceEquals(this.first,null)) ?
this.first.GetHashCode() : 0;
int secondHash = (!Object.ReferenceEquals(this.second,null)) ?
this.second.GetHashCode() : 0;
int thirdHash = (!Object.ReferenceEquals(this.third,null)) ?
this.third.GetHashCode() : 0;
Interlocked.CompareExchange(ref this.hashCode,
(Object)(firstHash ^ secondHash ^ thirdHash), null);
}
return (int) this.hashCode;
}
//...
} Tag: MSN chat integration Tag: 108617
Embed windows media player and possibly others in .net app?
I have a list of media files to choose from in the app. Right now
clicking on it will launch it using System.Diagnostics.Process.Start to
launch whatever appropriate application for that particular file. Since
I know the extension of the file, can I embed media player in the app
instead of having media player popped up and run separately, just like
embedding the media player in the web page with certain functionality
show? Tag: MSN chat integration Tag: 108615
How to add right click menu
Tool: Visual Studio 2005
I have a custom photo library application previously written in VS 6.
Basically it has
1) DriveListBox, DirListBox, FileListBox, all listed as
Microsof.VisualBasic.Compatibility.xxx
2) PictureBox inside a Panel (for auto showing scroll bars when photo
exceeds viewable area).
3) Buttons under FileListBox to Rename, Delete, etc file.
I'm thinking there must be something equivalent to Explorer that allows
you to single click to rename, right click with a bunch of options
(Rename, Delete, Cut, Paste, etc) that I can replace the FileListBox
with. If not, then I'd like to make it so that right click on a
selected file would prompt a context menu with a few basic options.
Thanks. Tag: MSN chat integration Tag: 108608
setting envrionment variable in C# and access it within native C++
We are having difficulties getting environment variable within native DLL
written in C++ which is loaded by C# .NET assembly, the env var is set by the
.NET assembly.
We have an existing C++ application, and want to access it within C#. So we
wrote Managed C++ wrapper which access the native C++ DLL. The Managed C++
wrapper is compiled as .NET assembly that C# can access.
The native C++ DLL need to have an environment variable set to work
properly. So within the C#, we use:
[DllImport("Kernel32.dll")]
public static extern int SetEnvironmentVariable( string name , string
value );
to set the env var.
But within the native C++ DLL, it will fail when trying to do "getenv()",
with error:
Object reference not set to an instance of an object.
1. If we make the C# application as console application and set env var in
the console before start the C# application, it works. But we can't make the
C# app a console app.
2. If we execute within the C# application a .bat file which prints out the
env var, it shows that the env var is set.
Looks that the native C++ DLL can't getenv() on the env var set within the
C# app.
Any solutions for this?
Thanks a lot. Tag: MSN chat integration Tag: 108605
programmatic to ftp virtual directories
programmatic to ftp virtual directories
when i connect to an ftp server and i only have access to a few of the ftp
virtual directories, do i just change directory to them after connecting and
having credentials authorized? is there some special protocol for changing
directories to authorized virtiual directories? Tag: MSN chat integration Tag: 108604
programmatic to ftp virtual directories
programmatic to ftp virtual directories
when i connect to an ftp server and i only have access to a few of the ftp
virtual directories, do i just change directory to them after connecting and
having credentials authorized? is there some special protocol for changing
directories to authorized virtiual directories? Tag: MSN chat integration Tag: 108603
ASP Windows Service or Console based application
Hi all,
I am confused as to what kind of application to develop. I have to create an
application thats like a "Engine" which continously monitors a DB or
whatever. It has to work even if the user logoff as this engine feeds some
other application.
I tried creating a Windows service that runs continously but the status
shows "Starting" and i cant "Stop" or "Pause" and was suggested by one
BravesCharm that "Status does not change as the service never notifies the
SCM that everything started OK" which makes sense.
Is there a way for windows service to start some other application? is yes
then how can i stop it from this windows service?
Please do give me suggestions on how to achieve this.
Thanks,
Stephen Tag: MSN chat integration Tag: 108601
Clickonce install from CD
Hi,
I generated the deployment files into a local directory with specified
installation URL.
My prolbems:
- If there is an internet connection on the client machine, it skips the
files on the local hard drive, immediately start downloading from the web.
- if there is no internet connection, the setup.exe fails (which is the
startup program from a CD), but the application icon installs the software
well.
I implemented a custom async update. When I call the CheckUpdateAsync method
I have got an exception in the Application.ThreadException event, not in the
AsyncCompleted event as the MSDN says (in the e.Error)...
Why?
Thanks.
lelez
------------
Here it is the code:
try
{
ApplicationDeployment dep =
ApplicationDeployment.CurrentDeployment;
dep.CheckForUpdateCompleted += checkHandler;
dep.CheckForUpdateAsync();
}
catch (System.Net.WebException)
{
// never runs!
System.Windows.Forms.MessageBox.Show("There is no internet
connection.");
}
catch (Exception ex)
{
xxxx.Common.Util.Logger.LogException(ex);
}
Here it is the handler:
private static void dep_CheckCompleted(object sender,
CheckForUpdateCompletedEventArgs e)
{
if (e.Error is System.Net.WebException)
{
System.Windows.Forms.MessageBox.Show("There is no internet
connection.");
return;
}
ApplicationDeployment dep =
ApplicationDeployment.CurrentDeployment;
dep.CheckForUpdateCompleted -= checkHandler;
try
{
if (e.UpdateAvailable)
{
ContinueQuestionEventArgs ce = new
ContinueQuestionEventArgs(e.AvailableVersion.ToString());
// Ask the user about continue...
if (updateIsAvailable != null)
updateIsAvailable(null, ce);
if (ce.Continue)
{
dep.UpdateCompleted += updateHandler;
dep.UpdateAsync();
}
}
}
catch(InvalidOperationException ex)
{
xxxxx.Common.Util.Logger.LogException(ex);
}
} // dep_CheckCompleted...
--
-----------------------------------
http://www.lelez.hu
ICQ: 177465172 Tag: MSN chat integration Tag: 108600
Caching architecture question.
I am thinking about using Caching application block in my web
application, for the performance reasons.
My ideal sitiuation would be if i could plug in the application block
between my Persistence layer and database, so that objects are created
from the cache and cost of CRUd operation can be avoided....
the problem each object is not having a unique key, and caching
application block does not provides any typed cache functionality, for
example if i store a product object wtih uid 1 and a customer object
with uid 1 then it would overwrite the product object,
Iam thinking about creating a multiple cache managers according to the
type of object, and keep all those cache managers in a super cache...
in that case would the scavenger clean up caches inside a cachemanager
object ?
any comments Tag: MSN chat integration Tag: 108595
Program for my scanner
This is a long shot, but here goes...
I have an HP scanner that came with some software I don't like at all. I
would like to write my own dotnet program. What is required? I suppose I
would need some sort of component (HP proprietary) to get started. Would HP
make such a component accessible for us? What can I do?
Thanks. Tag: MSN chat integration Tag: 108593
GDI leaks?
Hello all,
I've just found the issue that really scares me. It seems that ListView
doesn't release some GDI objects. Here you are steps to reproduce the
problem:
1. Run Task Manager
2. View->Select Columns
3. Check "GDI Objects", press OK
4. Run Visual Studio 2k3
5. Create new Window Forms application
6. Put into the form "ListView" and enter 5 items.
7. Run Application
8. Force application to refresh (e.g. move another window above this
application)
You will see that GDI objects increase really fast. The same situation
with Add/Remove items, GDI objects still increas. I've noticed that I
can increase it number even till 10k and after that application starts
to glitch.
It seems that the problem can be solved after:
GC.Colelct();
But this is *really* bad solution which significant impacts to the
performance of application.
Any ideas?
Thank you,
John Tag: MSN chat integration Tag: 108591
Web Config and regular string literal
I am trying to keep the body of an email message in the web.config, something
like
"We have received ..... blah.. blah.. \n Thank you, \n ... some whitty
closing line".
Anyway, when I read this it is always coming back as a verbatim string
literal and the email contains the escape chars (\n). How can I make this a
regular string literal so that the email body will recognize the escape
characters?
Thank you Tag: MSN chat integration Tag: 108590
RegionInfo.ThreeLetterISORegionName returns TwoLetterIsoCode for B
Hi all,
I need to get the ISO-3166 code for BOSNIA AND HERZEGOVINA.
What I am trying is
1) RegionInfo ri = new RegionInfo(5146); ==> works fine and gets RegionInfo
2) ri.ThreeLetterISORegionName ==> Output "BA". Expected "BIH".
But I only get "BA" - not "BIH".
Any help greatly appreciated
I have noticed that BA/BIH is not listed in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationregioninfoclasstopic.asp
Might this be the problem?
I have also read about synthetic cultures
http://blogs.msdn.com/shawnste/archive/2005/12/06/500675.aspx
But anyway, BIH is a valid code found in ISO-3166.
Any ideas how to get it via RegionInfo?
Thanks,
DPOMT Tag: MSN chat integration Tag: 108589
Dynamically import fusion.dll
I'd like to dynamically import methods from the fusion library (fusion.dll).
However, if I just do a straight [DllImport(blah)], I can't guarantee that I
get the .Net 2 runtime version.
I've found that the unmanaged method LoadLibraryShim in mscoree.dll will
return a module handle to the latest runtime version, the thing I can't
figure out is how to then use this handle to invoke methods on the library
from C#.
Any hints gratefully received! Tag: MSN chat integration Tag: 108588
System.Threading.Timer & W2K3 problem
Hi all,
I've implemented a Windows service application with c# and .NET Framework
1.1.
The service starts 10 timers of type System.Threading.Timer.
The service runs as expected on Windows XP and 2000 Professional.
On the Windows 2003 Server + SP1 (Intel Xeon) some of the timers stop firing
after a short period of time.
No exceptions are thrown and no deadlocks occur.
Do you have any resolution?
Thanks,
Mircea Tag: MSN chat integration Tag: 108581
automatic Time conversion ?
Hello all,
I am writting a client application that asks a DataSet from a server
(WebService) and displays it locally in a DataGridView. The DataSet has a
DateTime column. The problem is that the server and the client work in
different time zones, and somewhere in the client the time conversion is made
(added / substracted 1 hour). So in my grid I see different hours.
How can I stop that ?
Basically, I need to ignore this diference, but I can't find a way.
Please help. Tag: MSN chat integration Tag: 108577
Run exe on LAN machine
Please tell me how i can run .exe file on a LAN machine. I have
administrative permissions. I am using C#.NET Tag: MSN chat integration Tag: 108571
Hidden Attribute on file affects security?
Hi ---
I tried to write an application that uses a config file. When I set the
Hidden attribute on the config file, I found that my application was no
longer able to write (System.IO.File.WriteAllText as well as
System.IO.File.StreamWriter), and also not able to delete
(System.IO.File.Delete), the file. I get an access denied error.
However my application can remove the Hidden attribute, after which writing
and deleting work properly.
Is this expected behavior? If so, can someone point me to the documentation
that explains the relationship between hiddenness and file access?
thanks,
denise Tag: MSN chat integration Tag: 108563
Does Framework 2.0 trash COM for everyone else ?
We are running Server 2003 for our critical server applications. We
have been updating a number of core software pieces to VS2005 /
Framework 2.0. This software is installed and pretty much working as it
should.
The PERPLEXING issue to me is that I have antique VB6 COM components
that are failing after adding Framework 2.0 to this server. Usually when
the component is done after a lengthy process, and is returning to the
caller. The VB6 component seems to have completed successfully, but the
exception "Object variable or With block variable not set" is being
thrown to the calling script.
I have a VB6 test application which invokes the same VB6 COM component,
and it also fails with the same error, at this server. We are talking
about software that has been in there doing its job for years.
Wanting to see it fail first hand I ran the test application on a
development computer, W2K, and it of course runs fine.
Besides a few isolated and unrelated VS2005 applications of our own, the
only thing new on this computer is Framework 2.0 redistributable
installation. I have to be suspicious that this has some how trashed COM
for others. Tag: MSN chat integration Tag: 108557
vs2003 and .Net 2
Hello,
I have vs2003 installed in my computer, I want to try .Net 2, can I install
.Net 2 and still be able to use vs2003 and .Net 1? Please advice Tag: MSN chat integration Tag: 108551
cookie problem
Greetings...
I need desperate help with my problem.
I guess the solution is related in some way with the cookies getting
lost in the authentication process working with some web servers.
Appreciate any help you could provide.
I've created an application that does the authentication process
using forms. I've succeed to install it in a lot of web servers and
it works perfect. But, and here is the problem, in some of the web
servers this is what happens:
Starting the application the user has to follow the authentication
process. If the user fails to enter the password, the server
communicates him that either the password or the user name is
incorrect. At this point, the process works fine. The problem starts
when the user follow the authentication process correctly (user name
and password are correct), after this, the system fails to continue to
the next page, the user is sent back to the authentication page (like
he was trying to violate the security using the URL).
This problem happens when a user is trying to do the authentication
process in a client machine; it doesn't happen if the user is in the
server machine.
I've done some research and these are the results:
As the application works fine in most of the servers I've installed
it, it shouldn't be an application problem.
As the application gives the user an answer when either the user name
or the password is incorrect, the server is responding correctly.
As the application works fine if the user is in the server machine,
installation or database problems are discarded.
I've been tracking the cookies and this is what happens: If the user
is working directly on the server machine, the system creates the
cookies and everything works fine. But, if the user is working on any
client machine the cookie never arrives.
The problem is not on the client machines as if I connect them to
another server, the cookie is created and the application works fine.
The user is redirected to the authentication page because the cookie
gets lost (Again: The client machines works fine connected to other
servers) and he loses his credentials.
Searching through the web I've found that there is a problem with the
server name when it has characters like "_", but this is not my
case. I've tried names like:
Server/MyApp/Authentication.aspx
192.168.1.100/MyApp/Authentication.aspx
OtherName/MyApp/Authenticacion.aspx
But none of them works.
I hope I've been clear enough with my explanation.
Thanks in advance for any help you can give me.
PD: The application has been developed using C# in VS .NET. Tag: MSN chat integration Tag: 108549
"Directory Service error"
I have a problem with a .NET 1.0 system and Azman.
The error message I receive is
"A Directory Service error has occured".
The weird thing is that the error is not consistent,
it can occur for a day, then weeks can pass withouth the error to
occur and then it occurs again, so we haven't been able to
estimate when it present.
Can somebody help me with it? Tag: MSN chat integration Tag: 108548
SMTP and CDO.Message Object error
This is a multi-part message in MIME format.
------=_NextPart_000_0011_01C60176.1A6EDE40
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
In my Win app I found that using the SMTP object doesn't release =
resources after closing the application. During testing I have to open =
and close the app many times and I found that after about three times it =
locks up when I call the Send() method and returns the error "Could not =
access CDO.Message Object". I found that if I create a new Win App and =
copy and paste the code into it, then it runs fine for the first couple =
of times and then starts returning that error. I also noted that I can =
send as many email messages as I want and they all get sent with no =
error as long as I don't close the program. Unfortunately, not closing =
the program isn't possible and I'm creating new apps constantly as I =
test my code.
I have two theories. The first being that the program doesn't release =
SMTP resources and after a couple times running all the resources are =
used up. But if that's the case, then why does creating a new app always =
work? My second theory is that somehow SMTP holds a pointer the =
application calling it and it only lets each app have a couple pointers =
allocated to it. That's why new apps always work but then get locked out =
after a couple tests.
I tried using garbage collection to free resources, but the SMTP object =
is a WinNT object and I can't instantiate it directly. So garbage =
collection hasn't helped solve the problem. =20
After doing more testing, I found that if I leave the SMTP.ServerName =
empty, then it works everytime. The problem with this is that since I'm =
not specifying the corporate email server, then this isn't a reliable =
method for a production system. So this isn't a practical fix.
Any ideas?
Here is my test code:
static void Main()=20
{
Application.Run(new Form1());
System.GC.Collect();
}
private void Form1_Load(object sender, System.EventArgs e)
{
Send(person@email.com", person2@Email.com", "","test 2", "hello");
}
public void Send(string From, string To, string CC, string Subject, =
string Body)
{
System.Web.Mail.MailMessage Email=3Dnew MailMessage();
Email.From=3DFrom;
Email.To=3DTo;
Email.Cc=3DCC;
Email.Subject=3DSubject;
Email.Body=3DBody;
Send(Email);
Email=3Dnull;
}
public void Send(System.Web.Mail.MailMessage Email)
{
SmtpMail.SmtpServer =3D "smtp.ucsd.edu";
try=20
{
SmtpMail.Send(Email);
}
catch(Exception e)
{
string x;
x=3De.Message;
MessageBox.Show(x);
}
}
private void Form1_Closed(object sender, System.EventArgs e)
{
System.GC.Collect();
}
------=_NextPart_000_0011_01C60176.1A6EDE40
Content-Type: text/html;
charset="Windows-1252"
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=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>In my Win app I found that using the =
SMTP object=20
doesn't release resources after closing the application. During testing =
I have=20
to open and close the app many times and I found that after about three =
times it=20
locks up when I call the Send() method and returns the error "Could not =
access=20
CDO.Message Object". I found that if I create a new Win App and copy and =
paste=20
the code into it, then it runs fine for the first couple of times and =
then=20
starts returning that error. I also noted that I can send as many email =
messages=20
as I want and they all get sent with no error as long as I don't close =
the=20
program. Unfortunately, not closing the program isn't possible =
and I'm=20
creating new apps constantly as I test my code.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have two theories. The first =
being that=20
the program doesn't release SMTP resources and after a couple times =
running=20
all the resources are used up. But if that's the case, then why does =
creating a=20
new app always work? My second theory is that somehow SMTP holds a =
pointer=20
the application calling it and it only lets each app have a =
couple=20
pointers allocated to it. That's why new apps always work but then=20
get locked out after a couple tests.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I tried using garbage collection to =
free resources,=20
but the SMTP object is a WinNT object and I can't instantiate it=20
directly. So garbage collection hasn't helped solve the problem.=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>After doing more testing, I found that =
if I leave=20
the SMTP.ServerName empty, then it works everytime. The problem with =
this is=20
that since I'm not specifying the corporate email server, then this =
isn't a=20
reliable method for a production system. So this isn't a practical=20
fix.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Any ideas?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Here is my test code:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>static void Main() </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Application.Run(new=20
Form1());</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
System.GC.Collect();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>private void Form1_Load(object sender,=20
System.EventArgs e)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Send(<A=20
href=3D'mailto:person@email.com", person2@Email.com", =
"","test'>person@email.com",=20
<A href=3D"mailto:person2@Email.com">person2@Email.com</A>", =
"","test</A> 2",=20
"hello");</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>public void Send(string From, string =
To, string CC,=20
string Subject, string Body)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
System.Web.Mail.MailMessage=20
Email=3Dnew MailMessage();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Email.From=3DFrom;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Email.To=3DTo;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Email.Cc=3DCC;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
Email.Subject=3DSubject;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Email.Body=3DBody;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Send(Email);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Email=3Dnull;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>public void =
Send(System.Web.Mail.MailMessage=20
Email)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> SmtpMail.SmtpServer =
=3D=20
"smtp.ucsd.edu";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> try </FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
SmtpMail.Send(Email);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial><FONT size=3D2><FONT face=3DArial=20
size=3D2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> catch(Exception =
e)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> {</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
string=20
x;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
x=3De.Message;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
MessageBox.Show(x);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>private void Form1_Closed(object =
sender,=20
System.EventArgs e)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>{</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
System.GC.Collect();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></DIV></BODY></HTML>
------=_NextPart_000_0011_01C60176.1A6EDE40-- Tag: MSN chat integration Tag: 108547
Windows Service using ASP .NET
Hi,
I created a windows service to insert data into a DB,
First time I tired to insert data on_start() it starts perfectly but the
insert is for a single entry into the DB
checked Services and it highlights the stop button
Now I wanted it add data continously so i put a while loop and to exit if it
errors, i deployed and click "start" on services, this time it took a long
time to do start the service but the status was still "Starting" instead of
"started"
Data entry into the DB was normal, no error logs, created a new entry in
"eventvwr.msc"
the Problem: I cannot stop the service, I cant kill it.... what am I doing
wrong?
Please advice,
Stephen Tag: MSN chat integration Tag: 108543
Windows 98 and .Net Service
I knew it would happen. I have a large who customer wants to run our Windows
Service App on a Win98 Machine...
Is it possible to run a Windows Service developed in .Net on Win98?
If so, do I need to create a Service Control App to Start and Stop the
Service? If not, how do I start it (net start ServiceName).
Do I need to Install the Service using InstallUtil.exe?
Also how can I debug the app on the win98 machine?
Thanks for your insights. If you can direct me to a discussion, that would
be great! Tag: MSN chat integration Tag: 108537
Aborting the LoadXML method of XmlDocument
Is there any way to abort the loading and parsing of a large Xml document
using the XmlDocuemnt.LoadXml(filename) method? Tag: MSN chat integration Tag: 108536
Testing MenuItem.Shortcut with KeyEventArgs for equality.
Is there a clean way of testing whether a MenuItem.Shortcut is equal to a
value typed at the keyboard?
What I want to do is be able to see if a menu item shortcut was typed while
the menu item is disabled. I can think of some brute force methods, but I
hoped that Convert or some other class would do the trick.
Thanks in advance.
Valerie Hough Tag: MSN chat integration Tag: 108529
System.DirectoryServices works on one machine, but not another in same domain
I have a .net application that is basically doing:
=================================================================
DirectoryEntry root = new DirectoryEntry( GetRootPathString() );
DirectorySearcher search = new DirectorySearcher( root, someFilterString,
null, SearchScope.Subtree );
SearchResult result = search.FindOne();
=================================================================
All within the same domain, "result" is valid (ie, returns the results that
I expect) on one server and null on another. What should I look into to
start figuring out why "result" is null on the one server?
TIA// Tag: MSN chat integration Tag: 108528
how to fill a region
I have a bitmap and I want to fill an area that is delimited by the color
black, I do not know the path of the area, I just want to know how to fill
an given area by knowing a point inside it and the color of its border, how
can I do this ?
thanks.
mau.- Tag: MSN chat integration Tag: 108527
How do I use ConfigurationSettings.AppSettings collection safely
I've isolated a call to ConfigurationSettings.AppSettings.Get as the
source of an error in my application.
The 1.1 documentation for both the ConfigurationSettings class and the
NameValueCollection base class underlying the AppSettings collection say
that all static members (which I am calling) are thread safe.
What am I missing about accessing ConfigurationSettings from threads? Tag: MSN chat integration Tag: 108526
Windows Update Failed to install .Net Framework 1.0 SP3
Every other WU item has installed without incident except this one (which I
have tried to do many times)--XP SP2, .Net 2.0 & all the other major
updates. Does anyone have a clue as to why?
TIA!
--
TFWBWY...A Tag: MSN chat integration Tag: 108524
Stopping toolbars from dragging onto other specific toolstrip containers
Hi, Ive got 2 toolstrip containers on a page, the first should allow the
user to move a toolbar onto any of the 4 sides of the form, the 2nd
container should only allow the user to move the toolbar left or right
on the form (without detaching and re-attaching to another toolbar).
Is there an easy way of doing this? Tag: MSN chat integration Tag: 108522
Remoting between 2.0 and 1.1
Hi everybody,
I have a 3rd party 1.1 framework dll that I want to use in a .net 2.0
application. Alvin Bruney already told me here that I can't use it as a
reference in my 2.0 app because it will be run in 2.0. So, I'm wondering if
it's possible to make a little 1.1 app that will reference that dll and then
it will communicate with my 2.0 app using remoting. Will that work?
--
Hugo Vale
www.datastreamcs.com Tag: MSN chat integration Tag: 108519
Removing the navigation sound in Web browser
Hello,
since .Net Framework 2.0, it's now possible to use the built-in Web
browser component. I migrated my software to use it without any
problem. I don't use the browser for opening URL but instead I simply
generate the HTML content that I assign to the component using the
WebBrowser.DocumentText method.
I have only one problem left : each time I update the page content with
the above method, I get the "click" sound that IE produces when a new
page is refreshing. I couldn't find any properties to turn sound OFF.
Is there a work-around to make sure the browser doesn't make a sound?
Thanks,
Neb Tag: MSN chat integration Tag: 108517
Cannot instantiate EnvDTE.DTEClass class
Hello,
I am currently developing an add-in for Visual Studio .NET 7.0, 7.1 and 8.0.
I am using Visual Studio .NET 2003 to develop it and C# as a programming
language. I have installed Microsoft .NET framework 1.0, 1.0 and 2.0 on my
machine.
Normally, my add-in registers his own commands, bound to UI command bar
buttons. To perform a clean uninstall, I added an Installer class, in whose
Uninstall method I am trying to delete the commands, registered by my
add-in. But in this Installer class I don't have a valid instance of DTE
object, so I have to create it. The class which represents the Visual Studio
.NET IDE is EnvDTE.DTEClass
class. Unfortunately, when I am trying to instantiate it, I get the
following exception:
System.Runtime.InteropServices.COMException (0x80040154): COM object with
CLSID {3C9CFE1E-389F-4118-9FAD-365385190329} is either not valid or not
registered.
Now, I checked whether there is a such COM server with CLSID
{3C9CFE1E-389F-4118-9FAD-365385190329} registered in HKEY_CLASSES_ROOT\CLSID
(that is there is a well-formed key under
HKEY_CLASSES_ROOT\CLSID\{3C9CFE1E-389F-4118-9FAD-365385190329} having the
required InprocServer32 subkey, pointing to:
EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
I also created a standalone Windows forms application that actually tries to
create a new instance of DTEClass class, but still I have the same
exception. That is to show that this error is not caused by Windows
Installer or something - this is obviously a generic error.
I found an article in Internet about the same problem, but still it hasn't
any prescribed solution for it. Does anyone has an idea how I can solve this
issue?
Regards,
George Jordanov Ivanov Tag: MSN chat integration Tag: 108514
Code only executes on Step Through
I am using VS 2005, VB.Net. I need to connect to an FTP server and get a
list of files. I plundered the following code from MSDN to accomplish this
task. It was part of a class called clsFTP:
Public Function GetFileList(ByVal sMask As String) As String()
Dim cSocket As Socket
Dim bytes As Int32
Dim seperator As Char = ControlChars.Lf
Dim mess() As String
m_sMes = ""
'Check if you are logged on to the FTP server.
If (Not (m_bLoggedIn)) Then
Login()
End If
cSocket = CreateDataSocket()
'Send an FTP command,
SendCommand("NLST " & sMask)
If (Not (m_iRetValue = 150 Or m_iRetValue = 125)) Then
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
m_sMes = ""
Do While (True)
Array.Clear(m_aBuffer, 0, m_aBuffer.Length)
bytes = cSocket.Receive(m_aBuffer, m_aBuffer.Length, 0)
m_sMes += ASCII.GetString(m_aBuffer, 0, bytes)
' Console.WriteLine(m_sMes)
If (bytes < m_aBuffer.Length) Then
Exit Do
End If
Loop
mess = m_sMes.Split(seperator)
cSocket.Close()
ReadReply()
If (m_iRetValue <> 226) Then
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
Return mess
End Function
I connect to the FTP server perfectly. The rest of the functions in that
class work great, such as download, upload, etc.. Sadly, GetFileList only
returns the first file unless I step through, then it returns everything I
have. If I put a break point at the Do While line, then run again, it
executes perfectly. If I let it run, it gives me just the first file. The
mask I am using is also correct.
Any clues??? It is driving me insane. Does the code look tight? I have
tried everything I know how.
Thanks,
Mike Tag: MSN chat integration Tag: 108513
i dont want to have my own chat application but instead integrate msn chat
with my application, are there any API exposed for it???