|
Dear ALL,
I want to call oracle(Developer) form (fmx file),from another application (c#).I want to call the form in such
a way that user dont need to enter login and password.I will hard code the username and password
in my C# application.User only press a button on C# form and and that button will open required Oracle form.
---------------------------------------
How can I DO this.PLEASE HELP............
Regards
|
|
|
|
|
Hi All,
I have a very simple problem .I want to rename a directory using C#.But
I am not changing the location of directory neither its name(letters)
just the case(from upper to lower or vice a versa).now if i use
Directory.Move or MoveTo method of directoryinfo class i get the
exception that source and destination must be different.one way around
this problem is that i should use move or moveto twice first moving
this directory to somewhere else then moving it again with the name
having different case.but i don't want to do that.Can somebody tell me
how to do this.Thanks in Advance.
Rakesh
|
|
|
|
|
First Create new directory for destination.
Than copy or move source.
|
|
|
|
|
Hi shafqaat,
You didn't get it.if my directory is C:\My Documents\pictures i want to Change it to C:\My Documents\PIctures .I mean i just want to change the case of some letters in the name of the directory.not its location.any suggestions.Thanks in Advance.
Rakesh
|
|
|
|
|
Since Windows has a case-insensitive view of the file system, "C:\My Documents\Pictures" and "C:\My Documents\pictures" is the same. You cannot change the case only. Try renaming it to "C:\My Documents\pictures.tmp" and then back to "C:\My Documents\Pictures".
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks for your reply.I know windows is case insensitive.In files case the case can be changed using MoveTo method of filesysteminfo class.it changes the case .is there any equivalent for directory may be any api or anything.thanks again.
Rakesh
|
|
|
|
|
Create a Directory Pictures(not on the same location of pictures).And move Contents of pictures to Pictures.
Delete pictures
Move Pictures to the location of pictures.
For optimization the best way is to create Pictures on same drive (the one have pictures) in any other dummy directory and than delete pictures and than move Pictures to location of pictures. Like
c:\\MyDummy\\Pictures
|
|
|
|
|
I have experienced this bug while doing a project on video playbak.(plz give any solution) if you set the interval to 1000 ms it work correctly and the lbl show 1 ms then if you set it to 33.3 the interval is 46.0
and her is a list of values i get
set | get
---------
15< | 15
15 | 15
16 | switch between 15 and 31
17 | 31
...
31 | 31
32 | switch between 31 and 46
...
46 | 46
47 | switch between 46 and 62
as you we can see the resolution here appears to be 15~16 but to my knowledge the resolution should be 900 us. please advise if there is any timer with a better resolution,thx
<code>
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Timers;
class TimerDemo:Form
{
System.Timers.Timer timerClock;
DateTime dtTimeStamp;
TimeSpan tsEllapsedTime;
Label lblTimeDiff;
public TimerDemo()
{
lblTimeDiff=new Label();
this.Controls.Add(lblTimeDiff);
timerClock=new System.Timers.Timer();
timerClock.Interval=33.3;
timerClock.Elapsed+=new ElapsedEventHandler(timeElapsed);
timerClock.Enabled=true;
dtTimeStamp=DateTime.Now;
}
private void timeElapsed(object sender, ElapsedEventArgs e)
{
tsEllapsedTime = DateTime.Now-dtTimeStamp;
lblTimeDiff.Text= tsEllapsedTime.Seconds.ToString()+":"+tsEllapsedTime.Milliseconds.ToString();
dtTimeStamp = DateTime.Now;
}
public static void Main()
{
Application.Run(new TimerDemo());
}
}
</code>
|
|
|
|
|
Your problem has nowt to do with the timer and everything to do with DateTime not being accurate enough to do millisecond-accurate timing.
|
|
|
|
|
I was interested in developing a small app that would keep track of my bank balance, and perhaps could even download a .QIF file from my bank's website.
It basically would need to access the web and enter a password protected account and retrieve information from that site
Is this possible to do and how do I go about setting something like this up? Any suggestions welcome.
thanks
-- Hard work is just an accumulation of the easy things you didn't do when you should have. --
|
|
|
|
|
It is possible, but a full explaination would be to length for this forum. Buttom line is that you need to send HTTP commands to the web server and then parse the HTML pages that will be returned.
|
|
|
|
|
Thanks. I appreciate that it is an involved process, and i am not looking for all the answers!
To get me started in the right direction, how do i go about finding out what what HTTP commands i would need to use and what information would i need to find when parsing the html?
Are you able to point me in the direction of any good tutorials or sources of info?
Thanks for your help!
-- modified at 18:20 Tuesday 29th November, 2005
|
|
|
|
|
I know of no tutorials or sources of info. My knowledge comes from over 8 years of testing web servers. It requires an in depth knowledge of HTML and the HTTP protocol. The best place for you to start is getting (do a HTTP GET to the banks home page URL) the home page for your banks web site. Doing HTTP commands with C# is pretty simple. The big problem is that there is no built-in capability to parse a HTML page. Over the years I've developed my own C++ dll for parsing HTML. Sorry, I don't have better news for you.
|
|
|
|
|
Hi fellows
My question is simple:
I have a very little program that I've created to understand the IEnumerator interface.
Here is a little piece of my software
//Method to populate my array
private void PopulateArrayList()
{
for(int i = 0 ; i < 4 ; i++)
{
m_MyDoors.Add(new Doors());
}
}
public void WhatDoorsIsOpened()
{
object CurrentDoor;
int i = 1;
IEnumerator NumberedDoors = m_MyDoors.GetEnumerator();
while(NumberedDoors.MoveNext())
{
CurrentDoor = NumberedDoors.Current;
if(((Doors)CurrentDoor).OpenClose() == false)
{
Console.WriteLine("Door {0} is opened.", i);
i += 1;
}
else
{
i += 1;
}
}
}
I've read in MSDN that IEnumerator supports a simple iteration over a collection. In this line of code:
IEnumerator NumberedDoors = m_MyDoors.GetEnumerator();
I'm just assigning the m_MyDoors' IEnumerable typed collection in the NumberedDoors, right?
In the MSDN too the following was wrote about IEnumerable:
Exposes the enumerator, which supports a simple iteration over a collection.
I've understand that IEnumerator assigns a typed collection.
I did'n understand the IEnumerator so good. The IEnumerable I didn't understand nothing?
Can anyone helps?
Thanks
|
|
|
|
|
Hi fellows
My question is simple:
I have a very little program that I've created to understand the IEnumerator interface.
Here is a little piece of my software
//Method to populate my array
private void PopulateArrayList()
{
for(int i = 0 ; i < 4 ; i++)
{
m_MyDoors.Add(new Doors());
}
}
public void WhatDoorsIsOpened()
{
object CurrentDoor;
int i = 1;
IEnumerator NumberedDoors = m_MyDoors.GetEnumerator();
while(NumberedDoors.MoveNext())
{
CurrentDoor = NumberedDoors.Current;
if(((Doors)CurrentDoor).OpenClose() == false)
{
Console.WriteLine("Door {0} is opened.", i);
i += 1;
}
else
{
i += 1;
}
}
}
I've read in MSDN that IEnumerator supports a simple iteration over a collection. In this line of code:
IEnumerator NumberedDoors = m_MyDoors.GetEnumerator();
I'm just assigning the m_MyDoors' IEnumerable typed collection in the NumberedDoors, right?
In the MSDN too the following was wrote about IEnumerable:
Exposes the enumerator, which supports a simple iteration over a collection.
I've understand that IEnumerator assigns a typed collection.
I did'n understand so good the IEnumerator. The IEnumerable I didn't understand nothing?
Can anyone helps?
Thanks
|
|
|
|
|
Hi.. I'm currently doing a web design on the calendar. I would like to ask that if i click the date on the calendar, how can i make it appear on the text box once i click on the date? I have tried several ways of doing it but it does not show out. Did anyone know how to call the date out onto the textbox? Your help will be greatly appreciated.Thank
Cheers!
|
|
|
|
|
You need to make your calendar control auto postback on selection, then set it in your codebehind.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
it seems that my program hangs (freezes) until the process that was started ends... how can i start a program without waiting for it to end?
thanks in advance,
sam kline
also, i have another noob question... how do i post code snippets (showing the code in a table)
|
|
|
|
|
Sam,
That's pretty wierd about the Process . It shouldn't cause your main app to hang. On the other hand, starting a new process is pretty expensive in the overall scheme of things. If you start a short-lived process, the time that the system takes to create the new process and start the application in it can overshadow the short run-time of the actual application. Do you think that you can post a little code snippet to show us in what context it's occurring?
To answer your second question, you can wrap some code in <pre> tags, like:
<pre>Code goes here.
And, this is indented. Nice, eh?
</pre>
becomes
Code goes here.
And, this is indented. Nice, eh?
Or, when you post your comment, under the emoticon row, there is a checkbox that essentially wraps your entire post in PRE tags.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
-- modified at 18:08 Wednesday 23rd November, 2005
|
|
|
|
|
Hello everybody.
I have a class A that publishes an event, and is using a delegate to allow other objects to subscribe to it. After raising the event, class A is sending some information wrapped up in the custom class deriving from EventArgs. When the event fires, the class is then going through the list of subscribers using the GetInvocationList() and is getting the response from the subscribers.
So far so good.
The problem is when trying to subscribe to the event from a class B that has no reference to class A.
It would be easy enough to add a reference to it and to just subscribe to the event, however we do not want to make the server code to reference the client classes.
Is there a way to do this differently? If not, that what about adding an intermediary object that can receive and pass on the events raised in class A on the client side, so that class B on the server needs only to reference one object* But if there's a better way then I would really appreciate some directions.
Thanks a lot.
Sarajevo, Bosnia
-- modified at 15:21 Wednesday 23rd November, 2005
|
|
|
|
|
mirano wrote: The problem is when trying to subscribe to the event from a class B that has no reference to class A.
It would be easy enough to add a reference to it and to just subscribe to the event, however we do not want to make the server code to reference the client classes.
You could make the event handler in Class B public and have a mediator class attach it to the event in Class A.
Or have an interface represent only the event that's in Class A that Class B needs to subscribe to. Hopefully, the event represents something easily identifiable so that it's easy to name.
Have Class A implement this interface. Pass an instance of Class A to Class B as a reference to the interface, not Class A. This way, Class B only knows about the interface. This decouples Class B from Class A.
mirano wrote: If not, that what about adding an intermediary object that can receive and pass on the events raised in class A on the client side, so that class B on the server needs only to reference one object*
I would go the interface route first. The interface is in essence doing the job that your intermediary object is doing, only basically for free.
-- modified at 17:47 Wednesday 23rd November, 2005
|
|
|
|
|
Thank you for your help, Leslie. I will give it a try today. The solution seems reasonable and I was thinking about the interface when I meant intermediary object, just everything is kinda upside down - the server is to subscribe to the event that the clients would raise.
The solution with the interface is a common one, but still I wanted to see is there some other pattern that we should use when going with a delegates, event though I could not remember seeing any such implementation.
The easiest way is to add a reference to the server, but doing that and in a short time the server implementation gets bloated with too many assemblies.
Thanks again.
Sarajevo, Bosnia
|
|
|
|
|
mirano wrote: The easiest way is to add a reference to the server, but doing that and in a short time the server implementation gets bloated with too many assemblies.
I can understand that.
If you do try the interface approach, you may want to put it in the server library/assembly. I'm assuming you have a server assembly and various client assemblies that use the server. In this situation, it's understandable that you wouldn't want the server referencing the clients to avoid assembly bloat, but also to avoid a circular dependency as well.
You could put a IClient interface (or whatever name seems appropriate to you) in the server library. It would represent the basic functionality the server needs to interact with its clients regardless of where or who they are. In this interface would be the event you described earlier. Client libraries would implement this interface and could register themselves with the server; something like a server.Connect(IClient client) method in which the server subscribes to the event in the IClient interface.
Alot of what I've described above is based on some assumptions that may not be true for your situation. At any rate, if it's helpful at all, cool. Just my 2 cents.
|
|
|
|
|
Could not get it to work.
Here's the problem: Class A implements the interface IClient that is on the server, everything's fine. When the method Foo of the class A is executed, the event is raised, passing some data class as a reference. Now, in order to subscribe to the event from the server, I need to do something like this:
Foo f = new Foo();
IClient icl = f as IClient();
and then:
icl.SomeEvent += new ... bla, bla...
but I DO NOT HAVE a reference to class A, method Foo, which is the whole point from the very beginning. Is there another way to subscribe to the event that is wrapped in the interface without having to know the class that's implementing it on the client side?
Thanks.
Sarajevo, Bosnia
|
|
|
|
|
You can have a reference to Class A on the server side without knowing its type as long as it implements an interface the server knows about and the reference is passed as a reference to that interface type.
Let's look at a bit of code so that what I wrote above is more concrete.
In the server library, you have the IClient interface:
public interface IClient
{
event EventHandler ClientChanged;
}
Also, we have the Server class:
public class Server
{
public void Connect(IClient client)
{
client.ClientChanged += new EventHandler(HandleClientChangedEvent);
}
public void Disconnect(IClient client)
{
client.ClientChanged -= new EventHandler(HandleClientChangedEvent);
}
private void HandleClientChangedEvent(object sender, EventArgs e)
{
}
}
Now, the Server can attach and detach itself to the client's event without having to know its type. All it knows is that the client implements the IClient interface.
Make sense?
On the client side, we do have to know about the server, but the dependency is one-side, i.e. not circular, so we're ok:
public class SomeClient
{
public SomeClient(Server s)
{
s.Connect(this);
}
}
-- modified at 13:12 Saturday 26th November, 2005
|
|
|
|