|
Looks like you answered half your question. For the other half, you need to associate your program with the file extension in the shell, and you need to accept a program path as a command argument when your program launches.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:23am.
|
|
|
|
|
Thank you. you are very good
|
|
|
|
|
Hi every body.
I Have A Question a bout load picture in ASP.NET With c#.
How can I load picture?
And How can I laod images with open command dialog(cadre Open)?
Plaese help me.
thank you
|
|
|
|
|
You mention ASP.NET, so do you really want the user to upload an image from their machine to your server?
|
|
|
|
|
hello.
no . i want open picture with dialog open.please tell me who i can load picture with open dialog?
i am beginner .
|
|
|
|
|
The OpenFileDialog is for Windows Forms, not ASP.NET. You need to allow the user to upload a file from their computer to your server. Your server cannot read files on a client's machine.
|
|
|
|
|
I didn't realise that this question was unrelated to your other one. We have an ASP.NET forum.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
We have unix boxes which are built for some very specific functions. We do not have direct access to work it however; we telnet to this box, navigate through the appropriate menus and then invoke the commands. We currently connect to these machines from windows clients via command prompt (by typing telnet.exe).
Lately we've found a way to do the telnetting programmatically. We are currently trying to bust our heads at automating "exact" operations. Basically I've to read a stream of data off a socket and then write commands to that socket based on that information. Is there any design pattern tht caters to this requirement?
PS: both reading/writing at the socket level happens asynchronously...
|
|
|
|
|
deostroll wrote: PS: both reading/writing at the socket level happens asynchronously...
it probably would be a lot easier doing all of it synchronously in a separate thread.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi,
I am trying to parse an Xml document into a SortedList and I need help!
The problem I have is that there are multiple <activitydetail> items nested inside <activitydetails>...and I can't figure out a way to increment a counter just for you when there are multiple elements inside another...
Xml document can be found here: http://pastie.org/680240[^]
Current code can be seen here: http://pastie.org/680242[^]
TIA!
|
|
|
|
|
My client software gets an RLE encoded TCP message from a Server. I need to decode it so I can use the data.
So my question. Does C# already have an RLE decoder? Or will I need to write my own stuff? It does not look hard, but I will feel silly if Someone say there is an extension that handles the work.
Thanks
PS They say its PackBits style
Programmer
Glenn Earl Graham
Austin, TX
modified on Monday, November 2, 2009 6:17 PM
|
|
|
|
|
|
They(Senior Developers at where I work) say its a "Traditional" form. They check to see if the previous character matches the current. If less than one or two they will attempt a sequence. If a sequence is found, they will write out the length and the sequence. If not the character and run length is attached to the buffer.
PackBits they say
Programmer
Glenn Earl Graham
Austin, TX
modified on Monday, November 2, 2009 6:18 PM
|
|
|
|
|
Ok I don't think .NET contains anything to deal with PackBits data..
Fortunately it isn't too hard to write a decompressor for
|
|
|
|
|
|
Hello all.
I'm feeling pretty confused about how the port forwarding is done. My situation is: I have Comp1 with a local IP (192.168.0.2) connected to Comp2 with external IP and internet connection, and some unknown Internet Client (IC), who needs to send data to the Server hosted at Comp1 through UDP port 7777 and then receive a response.
I managed to forward UDP data from Comp2 to Comp1 by simply accepting IC's packets at Comp2's port 7777 and sending them to Comp1's port 7777, but the problem is that Comp1's Server sees sender as Comp2 and sends response to it (192.168.0.1), rather than to IC.
So how do I forward IC's data from Comp2 to Comp1 with Comp1's Server knowing, that response must be sent to IC? I would also like to see the way it's done with TCP.
Here's what I managed to do:
namespace PortForwarder
{
class Program
{
public static UdpClient UDP1 = new UdpClient(7777);
static void Main(string[] args)
{
Console.Title = "Port Forwarder";
Console.WriteLine("-= Port Forwarder started. =-");
Console.WriteLine("UDP port 7777 forwarded");
UDP1.BeginReceive(ReceiveDataUDP1, null);
while (true) { };
}
static void ReceiveDataUDP1(IAsyncResult ar)
{
IPEndPoint IEP = new IPEndPoint(IPAddress.Any, 0);
Byte[] receiveBytes = UDP1.EndReceive(ar, ref IEP);
UDP1.Send(receiveBytes, receiveBytes.Length, "192.168.0.2", 7777);
UDP1.BeginReceive(ReceiveDataUDP1, null);
}
}
}
P.S. If it wasn't obvious enough, Comp1 is connected to the internet through Comp2's ICS (Internet Connection Sharing). Comp2 is running Windows Server 2008 and connects to the internet through VPN connection. I tried to set up NAT there, but VPN connection cannot be shared for some reason (and sharing public adapter doesn't help). If, by any chance, anybody knows how it's configured, I would be glad.
modified on Monday, November 2, 2009 11:37 AM
|
|
|
|
|
You'll could wrap the data that the IC sends to Comp1 with data describing where to send the response. Then the sequence of events can go like this:
* IC sends data to comp2
* comp2 wraps it with a header including information about who sent it
* comp2 forwards it to comp1
* comp1 generates a response that includes the header information
* comp1 sends the response back to comp2
* comp2 reads the header and forwards the response back to the original sender
or if comp2 can access the public internet then it can read the header and send the response directly. Doing this with TCP is pretty similar, just look up the TcpListener and TcpClient classes.
Boss5 wrote: while (true) { };
ew. Something like this might be better implemented as a service rather than a console app.
|
|
|
|
|
I thought about that, but the Server application is not mine, so I cannot modify it and implement header reading. Server decides the "source" of packet by UDP's IEP.
|
|
|
|
|
well then, the forwarder could keep a queue of sender information; when the forwarder receives something from an IC it queues the info and when it receives something from the server it can pop off the oldest info and forward the response. Of course you'd need to use a separate socket and port number to send data between the forwarder and server to keep the two data channels separate. That should work as long as each message received from an IC generates a response from the server and the server issues responses in the same order as it receives commands. If that isn't the case then the maybe the forwarder could use some smarts to only keep sender info for messages that will generates responses from the server.
Outside of that I'm not sure what to suggest. There might exist a hardware solution as you suggested in you original post but that's outside my area of expertise.
|
|
|
|
|
I tried that way too actually, but the problem is that there are, in fact, 4 ICs and the data is being sent at a pretty high rate, so responses become totally chaotic.
I have been trying to solve this for a week already and I would actually give up considering the task impossible, but there ARE actually port forwarders like AUTAPF, which succesfully forward all the data and return proper responses to proper places. Though the devs will not likely tell how they do it.
|
|
|
|
|
can i get a sample code for this port forwarding in linux C
Thanks
Sathish
|
|
|
|
|
No, for a couple of reasons:
1) this is the wrong forum to ask, there's a Linux forum and a C/C++ forum where this would be more appropriate
2) I don't have an example handy and
3) I don't have time to make one
You could try asking in one of the other forums but even then I'm not sure anyone would have a complete example handy for you. The articles on CP or Google may be your best bet.
Sorry.
|
|
|
|
|
Hi all!
I'm trying to build an MDI application with a fixed position left sidebar. On the right side I'd like to open other windows.
This is my problem.
When I open a child form, if I maximize it the form extends even under the side bar. The sidebar is now implemented with a panel anchored on top and bottom of the MDI main form (already set as an MDI container). The panel contains inside a treeview which links are used to open different child windows.
How can I make the sidebar panel a constrain for the MDI main form? So when I maximize a child form I can avoid child forms open partially behind the panel.
For those who know, as an example think about the layout of Oracle SQL Developer interface. The sidebar contains connections to databases and I've to do the same thing!
modified on Monday, November 2, 2009 10:41 AM
|
|
|
|
|
I have done this by using the following steps:
1) Start new Window Forms Project. Rename Form to MainForm, just so we both know what I'm referring to. You can just remember this bit if you have more than 2 brain cells.
2) Add ChildForm to Project.
3) Add Menu to MainForm, with MenuItems for adding child forms. Complete the event handlers.
4) Now add your Panel to MainForm and Dock as required.
5) NOW!! set IsMDIContainer to true for MainForm.
Works for me! Hope it helps you.
[Edit]
I have just realized that the above is complete rubbish. Oh it works, but the order is irrelevant.
I have just created a new application in which I set IsMDIContainer before doing anything else, it still worked,
So I don't know what is going wrong with your application.
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|