|
You could create a singleton object that manages a pool of modems (make it configurable in case you need to add more later).
The biggest problem you're going to face is timeouts, however. The default timeout - configurable for both ASP.NET and IIS (see the <httpRuntime> configuration section for how to control this in ASP.NET) - is 30 seconds. That's about how long it takes modems to establish a connection, nevermind downloading data. Waiting on a small pool of modems means the timeout from a client for a web service call is going to be greater.
You might consider .NET Remoting over a TcpChannel that is not hosted by IIS (if you host a .NET Remoting objects on IIS - whether or not you use a TcpChannel - an HttpChannel is used instead and HTTP is a one-way protocol by nature). You could define an event that the client would handle. Of course this is asynchronous, which may not fit your requirements.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks for this
Do you mean writing a tcp server accepting calls from the web application and responding back to it once it has completed communication with the modems? Does that also mean that ASP will have to initiate a tcp connection with the server and send a request rather than making a SOAP call to a web service?
I have no experience with singletons and very limited experience in .Net programming of serial ports, but have written a vb6 application that performs what i want to do exactly (i.e. calls the modem and gets the data)--is there a way I can use that?
Thanks again for your help
|
|
|
|
|
How do you populate a filelistbox?
|
|
|
|
|
There is no FileListBox class in .NET. Please be more specific about what you mean.
If you want to fill a ListView with files, then create an instance of the ListView class, set whatever properties you want on it (like ListView.View = View.Details for a columnar view), and enumerate files within a directory.
You can do that using the DirectoryInfo class, which you instantiate with a given directory path, then call GetFiles to enumerate the files, each of which will be referenced by a FileInfo class (along with their attributes, sizes, etc.).
If you search or browse this site's articles you can find several examples of enumerating files and displaying them in a myriad of controls including the ListView control.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
There is a FileListBox control. I had to go into Tools>Customize Toolbox menu, and then under the .Net Framework Components tab.
Or am I totally mistaken? Actually I think I am, I see now that it's namespace was Microsoft.VisualBasic.Compatibilit.VB6. Does this mean it's not usable?
If so I'll just do as you said and search on enumerating a ListView with the files.
Thanks for the help.
|
|
|
|
|
It's not a control in the BCL (base class library). The Microsoft.VisualBasic.Compatibility.dll assembly that defines the classes in that namespace is an assembly. Remember that VB6 and VB.NET are two completely different runtimes, sharing only syntax for most of the language. The compatibility assemblies are only so that you can easily migrate your codebase from VB6 to VB.NET.
You should use the ListView , though, if you can. This eliminates a dependency on an extra assembly for minimal purposes. If you search this message board (see "Search comments" above) for SHGetFileInfo you can even find a post I wrote some time back (it may be referenced multiple times) that can get you the icons for files, whether or not they actually exist on the filesystem (though, if they do exist on the filesystem you want to call SHGetFileInfo a little differently in order to get the proper icons for extensions with special icon and icon overlay handlers, like .xml files).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I'm not to much concerned about the info on each file. I'm going to do more research on you previous post about just enumerating a ListView with DirectoryInfo Class and GetFiles.
Thank you for the help.
17 year old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Update:
Just got my ListView populated with all the files from a specified directory. I ended up piecing most of the code together from MSDN examples.
Now just to filter the files and figure out a clever way of setting the directory from which to pull the files. But that's neither here nor there.
Thanks for the help!!
17 years old with too much free time.
...cooler than the other side of the pillow.
|
|
|
|
|
Could any one tell me how to maximize a form within a web project in C#?
I cannot find a direct way to do this unless it is a traditional Windows application where you simply code something like "MyForm.Maximize = true;".
Thanks.
William
|
|
|
|
|
Because you're working within a web page and are subject to the object model exposed by the browser (and you're limited in what you can do anyway). You can either add some client-side JavaScript to the page that uses the screen object or open a popup window using window.open that specifies the initial settings (which you get from the screen object). All major browsers expose such an object (it is part of the HTML DOM, after all).
If you need additional help, please ask in the Web Development[^] forum. With client-side scripting, this has nothing to do with C# (which is a managed language you would find either in an ASP.NET server application that simply constructs client-side HTML, JavaScript, images, etc.) or in a Windows Forms control to be hosted in an HTML page (like an ActiveX control).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello,
I have been looking for the answer for this but haven't seen anything clear.
I am new to c# and want to create a sorted list (or a collection with key/object) with the key as a string and the second element a class object that i have created. But this doesn't seem to work directly (I'm used to STL in c++).
It appears I have to do some work with this class object. Can someone point me to a place where this is properly described?
Thanks in advance, jb
===================================
jonathan borden
jrborden@austin.rr.com
|
|
|
|
|
|
Hi,
I have a TIMER and a WebBrowser component.
When the program goes to the System Tray and Timer Refreshs the WebBrowser Component ( i cant see the program form, normal), i loose the focus of my active window
How can i fix this?
|
|
|
|
|
The WebBrowser control - an ActiveX control that is hosted through an RCW, or Runtime-Callable Wrapper - is subject to its own focus handling. Either the AxHost (the base class for the AxWebBrowser class) has the focus or it doesn't, but how the WebBrowser control itself maintains focus is completely independent of .NET. IT could, for example, have the focus while the AxHost doesn't even realize it has the focus. This is a common problem (not just with the WebBrowser control, but with all ActiveX controls hosted in .NET).
Once way of solving the problem is to get the handle of the currently active window before you refresh the WebBrowser and then restore it. For this, you'll need to P/Invoke the native GetForegroundWindow and SetForegroundWindow APIs. If you need help declaring the P/Invoke signatures, see http://pinvoke.net[^].
To solve the problem with the WebBrowser control itself, you either need to correctly identify the container (this gets deep into COM interfaces, so experience in this area is helpful; there are some articles on this site that may help if you search for "WebBrowser", for example) or to make sure that the WebBrowser control never takes the focus to begin with. One way - and this is untested but should work - is to set the WebBrowser.Visible property (not the inheritted AxHost.Visible property!) to false . IF correctly implemented, the control should not try to steal the focus if it is not even visible.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
hi,i am a new bee in this group.
i need the c# code for backpropogation using neural networks in artificial intelligence.sorry for the confusion.if any of u got it then pleasw send mail me.
thanx a lot
kasi malla
|
|
|
|
|
You might define what you mean by "backpropogation" first. I've never seen such a word used in any context.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heath Stewart wrote:
backpropogation
I'm guessing the OP means undo (and possibly redo) functionality. If so start your search with "GOF Command Pattern".
|
|
|
|
|
are you talking about neural net's?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
I'm trying to achieve something similar to a VS.Net 2003 IDE where there is an option when you hover your mouse over, it slides out (If you set auto-hide enabled). Did anyone here have a sample code of how to achieve that ? Or guide me in the right direction ?
Stanley
|
|
|
|
|
Hi,Sir and Madam
Please give ma an idea about "word cutting" (not English).
Some language (such as Thai) a sentence has contigugous words and sentences separated by space while English a word separated by space and sentences separated by (,) and (.)
Example:
ยินดีต้อนรับทุกคน = Every one is welcome.
Sorry for bad English.
Thank You.
|
|
|
|
|
Try a search on word stemming[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
depending solely on web MSDN is not enough for me....
anywhere I can download?
thanks, all
dennis
|
|
|
|
|
The place to start would be on the web site you apparently so often visit: http://msdn.microsoft.com[^]. You should see Subscriptions[^] right there at the top. A little digging should turn up the MSDN Library Subscription[^]. It is definitely worth it and integrates fully with VS.NET (installing both into the VS Combined Collection as well as a stand-alone collection that VS.NET can reference directly; I prefer the Combined Collection in order to incorporate any third-party libraries).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
im using .net and how would you reverse the contents of a file so if
1
2
3
4
would be a file how would i write
4
3
2
1
???
thanks
IM PROUD TO BE A GMAIL;
|
|
|
|
|
StreamReader sr = new StreamReader(filename);
string t1, t2;
while ((t1=sr.ReadLine()) != null) {
t2+= t1+"\x1D";
}
string[] tsa = t2.Split('\x1D');
sr.Close();
StreamWriter sw = new StreamWriter(filename);
for (int i = tsa.Length-1; i >=0; i --) {
sw.WriteLine(tsa[i]);
}
Hope it'll help...
Robin Panther
|
|
|
|