
ilya2
Avatar/Signature-
Posts
29 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by ilya2
-
You may use some of the opensource FTP clients, have a look at http://sourceforge.net/projects/dotnetftpclient/ http://sourceforge.net/projects/ftpdotnet/ (Both need to compile in c#).
-
I've been doing a similar admin application and have used this approach too. I have only figured out one another usable way to upload the files: through webservice. However, that would result to mime-encoding the file, thus increasing the number of bytes up to twice and, possibly, another problems with big files that could be blocked at upload. So using FTP to upload images is OK, I think. I'm not quite sure about how it is about the security with FTP as I don't know if it is possible to use it along with SSL or some other secure protocol (maybe passive ftp is accomplishing this enough?). However, at my position, I don't need to secure the images I'm uploading. Other data, such as sql commands, xml files and so, that could be vulnerable and need to be uploaded securely, should be upladed using webservice through SSL. And a word about connection loosing: that's it, you just can't rely on a ftp connection persistance. The FTP connection may be broken anytime (though it should be rather rare unless there is some problem) and you may choose if you reconnect and continue or let the user decide. Everything has to be done in a transaction. You may try to repeat uploading files that have not been uploaded completely or discard them all if the transaction has not completed, but in every case you must save the information about which files have been uploaded and which have not.
-
Hi, I'm working on a chat application which uses HttpWebRequest/Response to communicate with a web service. Now I would like to add a feature that informs user about the actual (and accurate ;) number of bytes that have been sent/received so far. Do you have any idea about how to do this? I haven't found any way to intercept the HttpWebRequest/Response streams which would include any headers received or sent. Thanks a lot for your suggestions!
-
I lose InnerException at calling COM+
ilya2 replied to ilya2's topic in Interoperation / Office Integration
Thanks for your reply. This looks like a solution for me, I'm gonna check it. I'm not quite sure if it would work in my COM+ environment (considering object pooling / caching, threads and so), but I'll give it a chance. -
Using this code: string[] resourceNames = assembly.GetManifestResourceNames(); you can get the names of all embedded resources in assembly.
-
Hey, this worked! Thanks a lot ;)
-
Hi, I'm not quite certain about the behaviour of lock() statement. So, let me ask you this question. Is there any possibility to cause a deadlock when in my DLL, everywhere is a lock used this way: lock (typeOf(Class1)) { } (everywhere the same Class1 is used, even in other classes). And, is it any good way to achieve serial processing at all? Thanks for you ideas.
-
Hi, I have the problems getting original exception after calling COM+ method. Let me describe the situation. I've got 2 COM+ applications, both written in C#. One of them is calling the other one when some event happens, so let's call them listener and processor. The problem is, that the processor's method may result in an exception. The listener should then catch this exception and report it. However, the listener only gets "Exception has been thrown by the target of an invocation". Normally, I would look for the exception in InnerException, but hey, there is nothing in my case! Can anybody help me with this? Thanks in advance..
-
Yes, I was able to see them before. I've got an October 2004 library. It looks like there is a problem with Internet Explorer or such, maybe some damaged registry values.. but I don't see why the reinstallation doesn't fix it.
-
Hi, please help me with this problem. I can't view my MSDN library pages. The contents and index is shown, but when I click on the topic, the "Action canceled" error message is shown. At second try, the "The page cannot be displayed" message is shown. I've tried to reinstall MSDN and VS.NET, none helped. Does anybody know where could the problem reside? Thanks a lot
-
Hi, does anybody know if there is any way to avoid crashing FolderBrowserDialog when too long path is selected? I would like to avoid using thrid party components. Thanks
-
Q. Access and Adapter.InsertCommand
ilya2 replied to joe_pool_is's topic in Database / XML / Reporting
1) The first one is the parameter name, which is important in this case, the second one is SourceColumn which is used to fill the in-memory datatable back from datasource. 2) Yes, you must supply all parameters you want to be inserted this way. However, you may construct whole sql query in CommandText, such as cmdInsert.CommandText = "INSERT INTO Table VALUES(" + id.ToString() +",'" + desc +"')" But I still think using parameters is simpler because you don't need to care about data formatting. -
I think that's very annoying all about this databound grids and list and saving their state accross postbacks. As I've migrated from desktop applications to ASP.NET, I've started to have headaches. After postback, the DataSource of DataList is null, and the items are just recreated from ViewState. So, if you don't want to rebind it from database, you have a few possibilities. You can store your dataset in session, however, this is not recommended due to the size of data staying at the server then (but maybe the small datatables wouldn't be so bad ;). Or you can try to recreate your datatable from Items collection. I'm not so familiar with DataList and have found it hard to do it at first glance, so if it's not possible so easily, there is still a possibility to turn the ViewState off and store the DataTable items to some unvisible ListBox or what. Really weird solution, I hope I was wrong about it :)
-
I would try to do that by setting my FormBorderStyle to None and then adding my own TitleBar and border controls to the top and sides of the form and dock them.
-
Thanks, I'm going to do it by triggers, though I will have to provide the referrential integrity by triggers too. I think that's very annoying feature of MS SQL that it does not support ON DELETE SET NULL and ON DELETE SET DEFAULT syntax.
-
Hi, is it possible to create a nullifying cascade action in SQL Server 2000? I mean, if I delete a row from a master table, the references to that row in a detail table are turned to NULL. I was thinking it was a standard feature in SQL, but in MS SQL I could not find anything else than ON DELETE CASCADE, which causes child row deletion. Thanks
-
Your question is not clear enough. Please specify what do you mean by redrawing. Do you want to do your custom control drawing?
-
Try to declare form like this: frmSplash fSplash = new frmSplash(); You must leave the label public, however, I would recommend you not using controls on another form directly. Instead, create public properties in splash form that modify the contents of its controls.
-
Why don't you just use dropdown.SelectedValue after binding the data?
-
Maybe if you were able to enumerate explorer's windows you could get an access to explorer's WebBrowser component or an address bar. Have a look at Windows API.
-
Is it necessary to close StreamWriter?
ilya2 replied to ilya2's topic in Directory / File IO / Registry
Hm, maybe I'm missing something, but this code causes an ObjectDisposedException with message 'Cannot access a closed Stream'. MemoryStream memoryStream = new MemoryStream(); StreamWriter streamWriter = new StreamWriter(memoryStream); streamWriter.Write("Some data."); streamWriter.Close(); memoryStream.Seek(0,SeekOrigin.Begin); -
Hi, I'm doing some stuff with WebResponse and its response stream. I've created a wrapper class that copies the stream into its own stream so that it can be able to seek through the stream. I accomlish that by creating StreamWriter which writes data from the original stream to my stream. However, if I close the StreamWriter at the end, it also closes the underlying stream. Nobody can take that stream and read it then. So, is it ok to let the StreamWriter open so that the stream also stays open? Thanks
-
The solution is... I found out that this could be a possible reason of this behaviour: The paging controls in a grid have their IDs which are used to identify which event is to be raised by the postback. However, these IDs depend on how many rows are there currently shown in the grid (when paging controls are at bottom). So, when I turn the ViewState off, after postback there are no rows in grid, because they are not reconstructed. The grid now doesn't know how to resolve the IDs, it doesn't know it belongs to a page number a it doesn't raise PageIndexChanged event. I've solved this problem by binding the grid to some default data. Actually I've had to remember the last number of rows shown in the grid and store it to Session. By the postback, I fill the grid with default data so that it has the same amount of rows. I also have to set VirtualItemCount (I use custom paging) to some big number and CurrentPageIndex to the last selected page, which I also have stored. If I wouldn't do that and leave the CurrentPageIndex at 0, selecting the first page wouldn't lead to raising PageIndexChanged event again. Maybe this isn't quite a clear solution, however, it works now ;)
-
Maybe your event itself is causing an exception?