|
Within the actual code you can just replace all references of the auto namespace to the one you want. But then you also, if memory serves, right click on the Project and Solution and change the Default namespace and other namespace related fields. Also if you have an Installer project then you need to check it's various fields.
regards,
Paul Watson
Bluegrass
South Africa
Miszou wrote:
I have read the entire internet. on how boring his day was.
Crikey! ain't life grand?
|
|
|
|
|
How put an icon for a control, on IDE ?
|
|
|
|
|
|
Hello,
I'm putting together an app which has to list the files in a selected directory. I'd like to put together the tightest and most efficient solution possible.
I'd like to pull the file data from a specific folder and bind it to a repeater or datagrid form control.
Is it possible to pull multiple file types using DirInfo.GetFiles? I'm right now using wild cards combined with file extensions, but when I try using DirInfo.GetFiles("*.gif|*.jpg"), for instance, I get an error.
If this is not possible, can I bind two different file collections to a form control without having to first add them both to an arraylist or other collection, and then bind the collection to the form control?
|
|
|
|
|
A quick glance through the code says no. GetFiles ends up just tacking the search pattern on the end of the path and calling through to the native FindFirstFile/FindNextFile. They do not support anything but standard globbing. Sorry.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi!
I am designing a graphics editor in c#. I face a trouble, if i drag a complex graphics item, it will be impossible to draw it once between two movemove event. But in normal solution, movemove event processed one by one, then it will be long delay before the graphics show on the place mouse cursor on for the program will first draw it on several useless places where mouse moved before. Is there any solution in dotnet to peek the message? If a new mousemove message arrived, the program should abandon the work it is doing and redraw on new place.
I think it is the same when we move the scrollbar.
Any idea or demo?
Thanks!!
|
|
|
|
|
|
Hi,
I'm using HierarGrid Custom Control to display hierarchical grid that display parent child relations between two tables.
My project contain the main hierarGrid definition (in the main .aspx) and as child user control it shows a nested DataGrid (inside an ascx file). When i click on plus (+) template column of the main HeirarGrid the child rows are displayed in the Inside User Control that contain a Datagrid. This works without having to reload the page cause the nested template is filled at the first page load an the rest of work is done client side.
Up to now all works fine (for the showing data side).
Unfortunately the nested DataGrid User Control contain a Colum Template with a ckeckbox to select each child rows. Now, How can I recover all the selected rows of the nested DataGrid from my main aspx page(example pressing a button)? . I think that all i need is an istance of the grid object of the nested UserControl from my main aspx page (so i could loop trought all the selected checks of this grid) but at present I do not know how to do this...
Can anyone help me please?
many thanks in advance!
nedeus,
Italy
|
|
|
|
|
ops ... maybe the correct message board for this question was ASP.NET.. however any suggestion will be appreciated anyway (i use c#) ...
|
|
|
|
|
I'm developing a socket server application in C# that I plan to use primarily to provide Flash clients with "real-time" interactivity (like chat, games, etc.)
So I've seen tons of Multithreaded socket programming articles, and tons of Asynchronous socket programming articles. What about a multithreaded design with asynchronous socket programming?
As I've come to understand (correct me if I'm wrong), asynchronous sockets uses threads, managed by the system, to execute in the first place. Knowing this, would there be a sensible advantage to combine "manually" generated threads and asynchronous socket techniques? Would it mean any noticeable performance gain, provide more scaleability, or would the extra overhead actually slow it down? Would it be worth the time debugging the dang thing considering the above factors?
I've already written a multithreaded (sync) socket server in Java, which runs pretty well. On an old PII/400 w/128MB RAM it handled almost 900 concurrent connections all sending randomly timed messages before it crashed. CPU was at 32% and the reason it crashed was it ran out of RAM Mind you, the server was running as an NT Service through a C++ wrapper for Java written by Bill Giel. Overall, I was pretty pleased with those results, and the Java server is what I'm benchmarking against.
I'm just learning C# & .NET, although I'm not new to programming. I thought this would be a fun project to get cozy with .NET.
Any comments are appreciated - thanks!
oblius
http://www.oblius.com/
|
|
|
|
|
In short, no. Stick to the async model and let the threadpool manage the threads. The CLR threadpool isn't perfect; there are some obvious features it is missing, but for the type of usage you are describing it is both sufficient and performant.
Is there some unrelated reason you think you'd like to manage your threads manually?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I haven't touched async sockets yet, actually. I am currently writing it as a threaded app where a "main" WFC thread will spawn a thread for each connected client.
The intention in the end is to wrap it up as an NT system service, so the threaded model is necessary so I don't put any blocking code into the OnStart() handler.
I guess Async sockets would accomplish the same thing, though, wouldn't they?
oblius
http://www.oblius.com/
|
|
|
|
|
Absolutely, and the result will be _much_ more scalable than the one thread per client model. Network IO-wise all your OnStart() method should contain is something like:
Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
listener.Bind(new IPEndPoint(IPAddress.Any, favoritePort));
listener.Listen(backlogLength);
listener.BeginAccept(new AsyncCallback(OnAccept), listener);
And then your actual IO is in OnAccept, OnReceive, OnSend, etc methods.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Cool - thanks for the information. I'll have to give that a try too.
I'm going to do it both ways, just for teaching-myself-C# sake --- but this sounds pretty interesting!
oblius
http://www.oblius.com/
|
|
|
|
|
Hi, just trying to send a bunch of stuff to a message queue:
MessageQueue mq = new MessageQueue(".\\MyQueue");
mq.Send("Hello World!");
The exception thrown was:
"A workgroup installation computer does not support this operation"
It's an XP on which I ran this small code snippet.
|
|
|
|
|
How can you retrieve a private/public key from a certificate in a specified store on a local machine?
And can you create certificates programmatically? Of course, that's different kind of certs than those from a root CA.
|
|
|
|
|
Hi, how do you retrieve IP address and host name again?
|
|
|
|
|
ravfingcoder wrote:
how do you retrieve IP address and host name again?
Like you did the 1st time
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
that's how i did it my first time:
using System;
using System.Net;
namespace GetIPAddress
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
IPHostEntry hostInfo = Dns.GetHostByName("");
IPAddress myAddress = hostInfo.AddressList[0];
foreach(IPAddress address in hostInfo.AddressList)
{
Console.WriteLine("ipaddress: {0}", address.ToString());
}
}
}
}
u're welcomed.
norm
|
|
|
|
|
using System;
using System.Net;
class getip
{
public static void Main(string[] args)
{
IPHostEntry hostInfo = Dns.GetHostByName("host");
IPAddress myAddress = hostInfo.AddressList[0];
Console.WriteLine("ipaddress: {0}",myAddress.ToString());
}}
|
|
|
|
|
I am trying to figure out how to create a hidden column in the standard .net ListView control. The best I have come up with is to make the last column width 0, however that column is still resizable and the user can still see the resize handle when doing a mouse over. I want the column to be truly hidden from the user. Any ideas?
|
|
|
|
|
I'm not sure exactly what you're trying to do, but if you're trying to add some hidden data to a ListViewItem then I think you can just derive a new class from ListViewItem and add as many extra fields as you need of whatever type you need. They'd only be accessible from the code and the user would never know they're their. Is that what you're aiming for?
|
|
|
|
|
Wjousts wrote:
I'm not sure exactly what you're trying to do, but if you're trying to add some hidden data to a ListViewItem then I think you can just derive a new class from ListViewItem and add as many extra fields as you need of whatever type you need. They'd only be accessible from the code and the user would never know they're their. Is that what you're aiming for?
Yes that is sort of what I am trying to do Wjousts, however what I would want is a hidden data (member variable) available for every item in the list and I would want this data bound to the list item so that when an item is added, deleted or edited the corresponding hidden data follows suit. In Essence I would like something that behaved like a hidden column.
|
|
|
|
|
Hi
I want to send bitmap files from server to a client. Number of files is not defined... Can anyone suggest some good and efficient way to do it?
Currently I am doing this... but the problem is only first file is transfered. Any idea why?
<br />
TcpListener SERVER;<br />
TcpClient CLIENT;<br />
<br />
SERVER = new TcpListener(66);<br />
SERVER.Start();<br />
<br />
CLIENT = SERVER.AcceptTcpClient();<br />
<br />
System.IO.Stream STREAM = CLIENT.GetStream();<br />
<br />
Bitmap BMP = new Bitmap("J:\\test\\in\\1.jpg");<br />
BMP.BitmapImage.Save(STREAM,System.Drawing.Imaging.ImageFormat.Gif);<br />
STREAM.Flush();<br />
<br />
BMP = new Bitmap("J:\\test\\in\\2.jpg");<br />
BMP.BitmapImage.Save(STREAM,System.Drawing.Imaging.ImageFormat.Gif);<br />
STREAM.Flush();<br />
<br />
BMP = new Bitmap("J:\\test\\in\\3.jpg");<br />
BMP.BitmapImage.Save(STREAM,System.Drawing.Imaging.ImageFormat.Gif);<br />
STREAM.Flush();<br />
...............<br />
...............<br />
And on client end....
<br />
TcpClient c = new TcpClient("localhost",66);<br />
Bitmap b;<br />
<br />
try<br />
{<br />
int count = 0;<br />
<br />
while(true)<br />
{<br />
b = new Bitmap(c.GetStream());<br />
b.Save("J:\\test\\out\\" + count + ".gif");<br />
MessageBox.Show("One Saved");<br />
count++;<br />
}<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show("Out");<br />
}<br />
What I need it.... HELPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!!!
mE
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
Oh my... it's hard to tell where to start. Since you start off with a comment about 'good and efficient', the first big issue is there is no reason to load those bits into a Bitmap object on both the server and the client just to do a file transfer. The short answer is, stop doing that and just transfer the bits directly.
Why it breaks the way it does is actually interesting. So here's the long answer for those interested.
Bitmap, like the rest of System.Drawing, is mostly a thin wrapper of the unmanaged GDI+ library. With that constructor you are eventually invoking the GdipCreateBitmapFromStream(IStream, GpBitmap*) API. The 'flat' GdiPlus functions aren't documented to my knowledge, but a the C++ wrappers around them are. (System.Drawing doesn't use those C++ wrappers, it calls the flat functions directly.)
If you have a look at the unmanaged GDI+ documentation for Bitmap::FromStream() you'll notice that the stream you are loading from must be seekable. The managed wrapper hides this. Unfortunately it doesn't hide it in a perfect way. If the stream is not seekable it slurps the _entire_ stream into memory and then calls GdipCreateBitmapFromStream on a seekable memory stream formed on those bits. This is a design bug in my opinion, and they should have just throw an exception when handed a non-seekable stream.
Oh, and the ALL CAPS VARIABLE NAMES have just got to go too, btw.
--
-Blake (com/bcdev/blake)
|
|
|
|