|
Thanks for this, I'm going to contact the company whose server it is, it is a VMS machine, I suspect that this is where the problems lies.
Sean
|
|
|
|
|
Apparently this is a known problem with the ftpwebrequest class, it doesn't work with VMS machines because of the style of directory listing, although it may be possible to switch the style of listing to RFC, which I'll try.
Microsoft are apparently going to fix this in a future release.
Sean
|
|
|
|
|
Hi all,
I'd asked my question but no answer...
Maybe its better:
I want to save some information in my host(http://loaclhost/)
What can I do?(suppose that my file is a config file, and I don't want
to save it in a database)
I am using .Net
thanks
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
don't cross post
led mike
|
|
|
|
|
First, a friendly gesture: This is my first forum question at codeproject! I have probably read hundreds of articles, and forum threads on CodeProject.com, and to tell you the truth, I find that other people have already asked all the right questions and there are already answers! I love codeproject.com for that!
The reason I am not finding answers is probably due to the fact that I am kicking the tires on something quite new--only available in Visual Studio 2008 with .Net 3.5 if I understand correctly.
Topic of my question: The Microsoft UI Automation Library
[^]
This MSDN article is dated, February 2008, and I can hardly wait until this stuff has been out in the wild longer--because there is little to no searchable resources other than MSDN documentation which is usually quite sparse in my experience.
My first 'hello world' UI automation experiment involves simply daisy-chaining two graphical UI applications on the desktop, referred to below as, extractApp and renameApp. I have all the source code available for extractApp--I wrote it, using C# on .Net 3.5 with Studio 2008. I did NOT write, and do not have access to the sourcecode of renameApp application. From what I can tell, it is a pure win32 app, definitely not a .Net app, and there is no (uncryptic) CLI.
Goal: Application extractApp finishes processing files in a folder, and I would like it to be able to "hand off" this folder (by object or string name) to the renameApp. There is no CLI available to use, however the renameApp does contain a control that supports a DragAndDrop operation. That is, if you drag a folder from an Explorer window, onto this "list1" control of the windows form for renameApp, it will respond to this DragAndDrop'ed folder name.
Side note: There is a ContextMenuHandler in the Windows registry for accomplishing this same "DragAndDrop" type of operation that was installed by this renameApp that I wouldn't mind figuring out how to be able to trigger programmatically from my extractApp as well. If you have any suggestions as to how I might programmatically execute a "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\{classid-string}" when there is no (known, published) verb implemented in the registry to use with ShellExecuteEx, or System.Diagnostics.Process.FileName="rundll32.exe shell32.dll,verb" + dirname" I'm all ears as well.
I couldn't figure out how to do this with the information at: http://msdn2.microsoft.com/en-us/library/bb776883.aspx[^] I gave up after discovering that there is this new and cool UI Automation namespace in .net 3.5 anyway...
Problem: I fairly quickly deciphered (from the new Feb. 2008 UI Automation MSDN article) how to get the handle of the control (in the renameApp) which needs to act as the target (or System.Windows.Automation.InvokePattern ??) of the DragAndDrop event triggered normally, by a user, using this short simple code:
Process renameCommandAppProcess = new Process();
renameCommandAppProcess.StartInfo = renameCommandApp;
renameCommandAppProcess.Start();
if (false == renameCommandAppProcess.WaitForInputIdle(10000))
{
MessageBox.Show("'renameApp' did not respond in a timely manner.", "Missing 'renameApp' application...", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
}
else
{
IntPtr hrenameAppHandle = renameCommandAppProcess.MainWindowHandle;
if (hrenameAppHandle != IntPtr.Zero)
{
if (SetForegroundWindow(hrenameAppHandle))
{
AutomationElement aeForm = AutomationElement.FromHandle(hrenameAppHandle);
if (aeForm == null)
MessageBox.Show("'renameApp' did not hand over control in a timely manner.", "Missing 'renameApp' application?", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
AutomationElement aeButton = aeForm.FindFirst(TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, "List1"));
if (aeButton == null)
MessageBox.Show("'renameApp' did not hand over control: List1.", "Missing 'renameApp' application?", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
else
MessageBox.Show("'renameApp' found control: List1.", "Found it!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification);
}
}
}
By "16 patterns" I am referring to the table at the bottom of "Figure 6" of this article here:
http://www.codeproject.com/script/Forums/Edit.aspx?fid=1650&floc=/script/Forums/View.aspx[^]
Thankyou in advance for even taking the time to read this very lengthy post.
I apologize for any etiquette rules I overlooked in the FAQ.
-Phreud
|
|
|
|
|
How to open an application in 3.0 framework?
The app is built on VS2008, .net Framework 3.5 platform and now I need to convert it to VS2008 3.0 Framework.
How to do that?
Thanks
|
|
|
|
|
If you're using .NET 3.5 features, then you can't. If you don't use any of the newer features (such as Linq) then you can change it by selecting the project properties and change the Target framework. Do a recompile and you're good to go.
|
|
|
|
|
|
I thought that you could use LINQ on 3.0? But you'd have to install that extension set of things for VS2005.
|
|
|
|
|
That's true, but I didn't want to go down to that level of detail.
|
|
|
|
|
Pete O'Hanlon wrote: That's true, but I didn't want to go down to that level of detail.
That's unlike you
|
|
|
|
|
Ed.Poore wrote: That's unlike you
It's all part of the new user friendly, touchy freely me.
|
|
|
|
|
You want the use Macs too much
|
|
|
|
|
|
Don't cross post
led mike
|
|
|
|
|
I was not sure if the error is related to Visual Studio, or .NET Framework, or Managed C++. Anyways, the problem is resolved now. Thanks.
ARSALAN MALIK
|
|
|
|
|
Even just a nudge in the right direction would be much appreciated...
I'm trying to use events with remoting over a tcp channel (writing in C#, mostly), and I'm getting this Security Exception thrown:
"System.Security.SecurityException: Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this level."
I'm running this under an administrative account, and so far all the code is running locally on the machine. From what I've learned so far about security, I thought that all local code was defaulted full-trust permissions, so I'm not sure what the problem is. I've looked at several articles in various places, but most seem like just a general introduction to .net security.
Any help would be greatly appreciated.
|
|
|
|
|
bwilhite wrote: Even just a nudge in the right direction would be much appreciated...
I just wouldn't do it, period. The idea of an event is nothing more than an async message sent by the server to the client, i.e., not in direct response to a request, but in response to an event on the remote host side of the client server architecture. However the complications added by network protocols and security by attempting to use something as integrated as .NET events just seems like a bad idea. It is possible you have chosen an inappropriate approach given your requirements.
Eventing is reliable in case of named pipe scenarios on same machine but not over network. So if underlying sockets close connection eventing won’t try to establish it for you. Using events over network is not recommended. But if you still want to use it, this post takes us over a simple client server example
No mention of security issues but it might help somehow:
http://blogs.msdn.com/dotnetremoting/archive/2006/04/07/571020.aspx[^]
led mike
|
|
|
|
|
Thanks that gets me going in the right direction.
As far as not doing it at all...this is experimental at this stage, but the only other real option would be our own full-fledged remote proxy. The concept of an event is the right one here... From what I can tell, we'd be duplicating *a lot* of the work done already by .net remoting...but like I said still experimental, and not sure which way we might go anyway.
Incidentally, using a callback mechanism caused a similar security problem.
|
|
|
|
|
|
hi there,
i had the same problem once, my solution:
first, you have to supply some sinkproviders to your tcpchannel before marshalling your remoting object:
<br />
BinaryServerFormatterSinkProvider serverprovider = new BinaryServerFormatterSinkProvider();<br />
BinaryClientFormatterSinkProvider clientprovider = new BinaryClientFormatterSinkProvider();<br />
<br />
serverprovider.TypeFilterLevel = TypeFilterLevel.Full;<br />
<br />
IDictionary properties = new Hashtable();<br />
properties["port"] = 9876;
<br />
TcpChannel chan = new TcpChannel(properties, clientprovider, serverprovider);<br />
<br />
<br />
then you have to add some stuff to your shared assembly (where you share intefaces between server & clients)
add your event to the interface
<br />
public interface IMyServiceInterface {<br />
event System.EventHandler<customeventargs> MyEvent;<br />
}<br />
</customeventargs>
i also added a CustomEventArgs class to my shared assembly (System.EventArgs wasn't sufficient for my application, but you could just use EventArgs if you don't need to supply some custom information to your Eventhandler)
then (maybe the most important thing) add an eventwrapper to your shared assembly:
<br />
[Serializable]<br />
public class MyEventWrapper: MarshalByRefObject<br />
{<br />
public event EventHandler<customeventargs> OnWrapperMessage;<br />
public void WrapperMessagehandler(object sender,CustomEventArgs e)<br />
{<br />
if(OnWrapperMessage!=null)<br />
{<br />
OnWrapperMessage(sender, e);<br />
}<br />
}<br />
public override object InitializeLifetimeService()<br />
{<br />
return null;
}<br />
}<br />
</customeventargs>
now you can use the event in your client the following way:
<br />
IMyServiceInterface service =
MyEventWrapper w = new MyEventWrapper();<br />
<br />
service.OnLogData += w.WrapperMessagehandler;<br />
w.OnWrapperMessage += handler_formyevent;<br />
<br />
...<br />
<br />
<br />
void handler_formyevent(object sender, CustomEventArgs e)<br />
{<br />
}<br />
maybe it looks a little bit complicating but that was how i managed the problem that you cannot use events in a normal way over remoting channels.
i hope this helps
|
|
|
|
|
Thanks. That seems to be pretty much what I ended up doing. The article I was going off of called it an event shim. One thing that isn't really clear to me is why the wrapper/shim works. In other words, you can't just do
<br />
service.OnLogData += handler_formyevent;
You have to give it to the wrapper, which can subscribe (why, I'm not entirely sure), and then subscribe to the events that it raises.
<br />
MyEventWrapper w = new MyEventWrapper();<br />
<br />
service.OnLogData += w.WrapperMessagehandler;<br />
w.OnWrapperMessage += handler_formyevent;
hmmm...is it because the wrapper is known to both assemblies that it works, whereas doing it the other way, the service isn't really aware of the subscriber? So in the scenario where it doesn't really know about the subscriber it can't grab a remote reference to it, so that it can marshal the events over?
I hope that makes sense...is it correct?
BW
|
|
|
|
|
Hi all,
I have two questions to ask:
1.I am writing a web service that gets some information and ...
And I want to save this information to an XML file ...
In other words I want to Create,Edit,Delete and save an XML file over the internet and I thought by using a web service I can handle that...
But XmlWriter doesn't support URI format...please help me...
2.How to use an Object (like datagridview) in a thread?
I mean cross-thread operations...I tried to use CheckForIllegalCrossThreadCalls=false
but as MSDN says it is unsafe and also it dosn't run well...
Please help with any of issues...
thanks...
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
I see points made, is there a specific question in there?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Why would you want to do either of these things? They both sound like terrible ideas.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|