|
I asked my client to talk to his IT. This is the response:
If you are talking about our outgoing proxies used by internal browsers to access the Internet, we use NetApp proxies. The authentication methods allowed are NTLM and Basic Auth. Let me know if this is or is not what you are looking for.
Is that consistent with your comments above? The default credential cache didn't seem to work in my tests.
|
|
|
|
|
The big question is how the browsers are configured. Most corporate networks these days seem to use automatic configuration through a script like I mentioned before. WebProxy.GetDefaultProxy will not pick this information up automatically, so you would have to configure these settings yourself and set the instance of your WebProxy to the HttpWebRequest.Proxy property. If you read about the HttpWebRequest.Proxy property in the .NET Framework SDK, you will find more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Ugh, sorry about that nasty formatting. Let me try again:
I asked my client to talk to his IT. This is the response:
If you are talking about our outgoing proxies used by internal
browsers to access the Internet, we use NetApp proxies. The
authentication methods allowed are NTLM and Basic Auth. Let me
know if this is or is not what you are looking for.
Is that consistent with your comments above? The default credential cache didn't seem to work in my tests.
|
|
|
|
|
I'm getting a "The process cannot access the file myfile.bak because it is being used by another process." exception for the following code:
<br />
if (File.Exists("myfile.xml"))<br />
{<br />
if (File.Exists("myfile.bak"))<br />
File.Delete("myfile.bak");<br />
<br />
File.Move("myfile.xml", "myfile.bak");<br />
}<br />
The exception is happening on the File.Move() operation. Unfortunately the File class does not have a flush() or close() method that I could use. Can anyone suggest anything else ?
|
|
|
|
|
Try this:
if (File.Exists("myfile.xml"))
{
if (File.Exists("myfile.bak"))
File.Delete("myfile.bak");
Application.DoEvents();
System.Threading.Thread.Sleep(500);
File.Move("myfile.xml", "myfile.bak");
}
It may let the operating system perform the function before you attempt to move the file. Another option is to just do the move without doing the delete.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
Thanks for the quick reply but unfortunately no dice. I still get the exception even after I started playing around with the time interval for the thread. I suspect the problem is inside File.Move(); for some reason that operation will not create "myfile.bak".
|
|
|
|
|
Did you try my second suggestion to do the File.Move WITHOUT the File.Delete ?
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
Yeah I did. I got the same exception. After tracing through it with the debugger the exception is thrown by File.Move(). I just don't know why. Is it a problem that I'm trying to rename my file to something that doesn't exist ?
|
|
|
|
|
No, you would get an exception if the file DID exist, as the method documentation states rather clearly.
It's possible it's not you using the file, either. The exception message states that the file is in use by another process. That could be use, or it could be another process. Make sure nothing else is using the file.
I've never had any problems deleting and moving files in two fell, sequential swoops. Some process - yours or not - is also using the file.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Here's the real kicker; the file does not exist. MyFile.bak does not exist on the hard drive so no other process can access it (I've also verified this by using SysInternal's handle program see what process is using what file and MyFile.bak was not in the list as expected).
|
|
|
|
|
The problem may also be that your SOURCE file is in use, not the destination. If you app has just written the .XML file, make sure that it was .Flush ed, .Close ed, and then the FileStream object .Dispose ed. This will release the unmanaged file handle in use by the FileStream object and release your file so you can rename it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I've been testing this problem and I came to the conclusion that it is specific to my machine only. When the code executes on someone else's machine it works fine. Thanks for all who replied trying to help me fix this problem.
|
|
|
|
|
When my app starts up it needs to spend a few seconds getting data from a database, and structuring tables etc. The user needs to know something is going on while this happens so I made a simple form that gives some feedback e.g."xxx is now loading".
Trouble is, the app is so busy loading the data that it never gets the chance to write the text in the form. The title is there, but little else (until the data has finished loading, when the form is not required any more anyway!) - just empty 'holes' which let the underlying screen show through.
There must be a simple solution to this but it eludes me.
|
|
|
|
|
What is required here is to have the main form perform the tasks while another form on another thread is processing the display. While it sounds complex, we have an article here[^] that will implement everything for you. I like this screen because of the predictive nature of the status bar. The only item I don't like is that it shows no progress the first time it is run unless you prepopulate the registry.
If you'd prefer other approaches, do a search from the home page for articles on Splash Screen.
|
|
|
|
|
Thanks 'Condor', this is a bit top-heavy in terms of code size (compared with what I was expecting!) but I have to admit the result is very nice. I'll use it.
|
|
|
|
|
You're welcome.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
I have a couple of questions about list box scrolling:
1. How you handle scroll events?
2. How do you get and set scroll positions?
Gary Kirkham
A working Program is one that has only unobserved bugs
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Who you are in Christ
|
|
|
|
|
Extend the class, override WndProc , and handle WM_HSCROLL (0x0114) and WM_VSCROLL (0x0115). I suggest defining two events and their virtual handlers (VScroll event fired by OnVScroll handler, and HScroll event fired by OnHScroll - the recommended way of defining events) and fire those along with any data you want in your WndProc override.
To set the position, you P/Invoke SendMessage and send those messages to your control's HWND (window handle, exposed by the Handle property). Note that when setting the position, you must also update the scrollbar position information by P/Invoking SetScrollInfo . Why and what you should pass is documented on MSDN[^] if you lookup WM_VSCROLL .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
When I try to make and test it in server explorer, this error message has shown:
Test connection failed because of an error in initializing provider. Cannot start your application.
The workgroup information file is missing or opened exclusively by another user.
Database was closed.
|
|
|
|
|
If you read the documentation for Access, you'd see that a workgroup file is an .mdw file (IIRC, it's been a while). There is a system default installed in the installation directory for Access, but if a particular .mdb file (Jet Database) uses unique credentials, it will have a different .mdw file (typically in the same directory). I don't remember what the connection string property is called (and those Access docs will tell you), but you must include that property and the fully-qualified path to the .mdw file, as well as credentials (User ID and Password) that are defined in that .mdw file in order to access the .mdb database.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
i'm trying to simulate what ping.exe does and send ICMP packets to a host. how can i do this in .net?
|
|
|
|
|
|
You could make your own using raw sockets and the ICMP protocal. But you don't have to becaue there is already a class to do it for you.
Icmp Class[^]
/\ |_ E X E GG
|
|
|
|
|
like others have suggested, u can use RawSockets and ICMP protocol type, or use an existing class like the one eggie5 has suggested.
Be aware that not all machines respond to ICMP echo request (which is what PING uses), and many firewalls might treat lots of ICMP echo request as an attack. The question is what are you trying to simulate? if you're in control of the host, have you considered using UDP?
|
|
|
|