|
I'd suspect that the bitmap only supports a single image.
Try something like this:
byte[] buffer = new buffer[1024];
int count;
while ((count = responseStream.Read(buffer, 0, buffer.Length)) > 0)
fileStream.Write(buffer, 0, count);
That should get you the file.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanx Andy, the code u supplied work perfectly, now it gets all the pags in teh TIF image, and my app has been finished and released.
Thanx again
|
|
|
|
|
Hi,
I am using the listview in the grid format i.e Listview.View.Details.
I have an urgent requrement where in I have to show checkbox and combo boxes in each subitems. In other words there should be few checkbox columns and few combobox columns in the listview.
Currently I am able to show check box for each item in the listview(i.e each row) but I need it for each cells.
Any help/suggestions is highly appreciated
Regards
Hitesh
hiteshsalian@yahoo.co.in
|
|
|
|
|
Serach Code Project. There are very good articles exemplifying exactly that.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
I have written a simple server/client program in C# using System.Net.Sockets, when I attempt to connect to my own computer using the local ipaddress it works fine. When I attempt to connect to other computers using my server program it doesn't work. When I attempt to connect to my own computer using my true ip address it doesn't work. I am connecting using TCP, anybody know why this happens?
|
|
|
|
|
Cofirm your machine has a true IP Address, and You will have it only when you have an adapter.
Try to ascertain using a ping command
CMD > ping <IP Address>
love2code
|
|
|
|
|
Hi everybody. I need to get the .bmp and .ico resources of an excecutable file(.exe) or a .dll file, Using the PE and RVA. Please if anybody can helpme, i will be gratefull.
|
|
|
|
|
And you want to do this in C#? That's a difficult task. I would write the application in C++, and use the resource API functions[^] to get the resources.
There are routines to find all the resources (EnumResourceNames and EnumResourceTypes ) and to modify them (UpdateResource ). Browse MSDN and you'll find a lot of information.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Can anyone please tell me how to convert the Windows Application that was developed in C# to ASP .NET web application
|
|
|
|
|
You'll have to rewrite the entire user interface. And hopefully, if you designed your application well, you'll be able to reuse the business and database logic without many (if any) modifications.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Does DataGrid in windows app. support paging?
If yes then how can I turn it on?
If no then is there a way arround it?
Also I would really like to customize the look of my datagrid like align columns to "center" etc, or may be have certain values BOLD etc, stuff like that.
In ASP.NET we could use DataGrid.ItemBound event or something like that, what can we do in windows app.?
|
|
|
|
|
|
I have an application which was originally in VB, but when I came on board, it was on the condition of moving to C#. Everything works well, I've been doing it for months now. There's just one problem. The app uses a lot of user controls, and one control, whenever I edit in the design view, at the top of InitializeComponent method changes. It goes to this:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DetailsActions));
which gives me this error:
Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "DetailsActions.resources" was correctly embedded or linked into assembly "RDC".
The resx file is an embedded resource. If I change the code to this:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager("RDC.controls.DetailsActions", System.Reflection.Assembly.GetExecutingAssembly());
everyone is happy. But I've accidentally sent a broken build to my employer, within a 40 MB installer, so I'd really like to work out the core problem so it just stops happening.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There can possibly be three reasons (however, in your problem, reason No. 1 below is more probable) for the problem:
1. The default resource file should be in your main assembly. When you use the following code:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DetailsActions));
the resources are not found in the assembly in which they are being searched. However, when you are giving the details of the assembly in which the resources are available (as well as when you are giving the full qualified path of the resource by providing “RDC.controls.DetailsActions ”) by way of the following code:
System.Resources.ResourceManager resources = new System.Resources.ResourceManager("RDC.controls.DetailsActions", System.Reflection.Assembly.GetExecutingAssembly());
the search for the resource concerned is conducted in the right assembly whose details are now available in the command System.Reflection.Assembly.GetExecutingAssembly() .
So, basically it is a question of giving the default name and path vis-à-vis the fully qualified name and path . When you supply the fully-qualified name and path, the resource can be located, whereas with the default name and path the resource cannot be found.
2. The resource is marked as private. This is what MSDN describes: Resources marked as private are accessible only in the assembly in which they are placed. Because a satellite assembly contains no code, resources private to it become unavailable through any mechanism. Therefore, resources in satellite assemblies should always be public so that they are accessible from your main assembly. Resources embedded in your main assembly are accessible to your main assembly, whether private or public.
3. The third reason could perhaps be when you are using satellite assemblies for different cultures and when you are not providing the correct path for the resource for the particular culture being used. However, apparently this is not your problem, because your problem is getting resolved when you provide the fully qualified name and path.
So, apparently the answer to your problem lies in the reason No. 1 above. To ensure that the problem does not occur, be sure to keep the resource at the appropriate place in a conscious manner and give full name and path.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Thanks for this detailed answer. There are a couple of problems though
1. This resource is created by Visual Studio, and I've never moved it
2. I do not support more than one language in my application
3. Because it's loaded in the InitializeComponent method, I am powerless to stop the IDE from changing that line of code, every time I edit the form.
I'll check if it's been marked private, do you have any other suggestions ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What appears to me is that when the default ResourceManager method with one parameter, i.e., ResourceManager(typeof(DetailsActions)) is called, it is getting called in the correct assembly (i.e., "RDC") because the error mentioned by you clearly shows the name of the assembly being searched, i.e.,
"Make sure "DetailsActions.resources" was correctly embedded or linked into assembly "RDC"."
So, when you compare the aforesaid single-parameter ResourceManager method with the two-parameters method namely ResourceManager("RDC.controls.DetailsActions", System.Reflection.Assembly.GetExecutingAssembly()) , it appears that the assembly is being identified correctly. The only problem is that the call to typeof(DetailsActions) is resulting into something like "DetailsActions " instead of resulting into the required fully qualified Namespace / path of "RDC.Controls.DetailsActions ". So, perhaps what is required to be done is that when the InitializeComponent method of the user control is called for the purpose of constructing the embedded resources, it should make typeof(DetailsActions) to produce fully qualified Namespace / path of "RDC.Controls.DetailsActions ". So, I wonder whether the Namespace mentioned in the source file containing the user control can be changed to the fully qualified Namespace of "RDC.Controls.... " if it is not so already and whether it helps in solving the problem. If it does not help (unfortunately I cannot visualize your actual code), you may please try to somehow ensure that the typeof operator when run on the class of user control returns the full Namespace path. This problem might perhaps have arisen due to the user control having been initially designed in one environment and then the same being copied to a different solution leading to conflict of namespaces.
As an alternative, you may also try changing the default namespace to the fully qualified namespace (if not so already) in the properties of the project containing user control.
I can only hope that it works.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
In my application I am using a StatusBar of which I need to change Icon dynamically on different event. I did something like this:
Icon redIcon = new Icon(@"C:\Documents and Settings\Me\My Documents\Visual Studio Projects\Invoices\Icons\Red_light.ico");
statusBarPanel1.Icon = redIcon;
But when I tried to deploy this application the package and deployment wizard did not include the folder under my solution. So, when I installed it to any PC other then mine, I got an error:
Could not find a part of the path "C:\Documents and Settings\haider\My Documents\Visual Studio Projects\InvoiceQueue\Icons\Check.ico
How can I use these Icon files that my setup project includes it.
Also lets assume that I included these files in my setup project but how would I know the path of that Icon folder because right now I am hardcoding the location but user may change the location of installation etc.
In ASP.NET we used Server.MapPath but how or what technique I need to use in Windows Applications? Thanks a lot for your time in advance.
Best Regards,
Rob
-- modified at 16:48 Wednesday 14th September, 2005
|
|
|
|
|
Hi Rob,
you have two choice, either embed the icons as resources or include them as content.
If you use the content, I cant remember the syntax in c# but for vb.net it would be something like:
dim redIcon as new Icon = Application.startuppath & "\red_light.ico"
Check the help in VSS quickly, or look on here for the conversion to c#. Very simple.
Andy
|
|
|
|
|
As the other reply suggests, I would rather embed the resources in the assembly. Add the icon to the project in Solution Explorer and in the property window, select Embedded Resource instead of Content.
And in code, use something this constructor[^]:
Icon icon = new Icon(GetType(), "IconName.ico"); I hope this helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Hi
I have a status bar in my main form. This status bar displays different text. I need to display a tooltip with a text (on mouse over) if the text is too large to fit into the status bar - if it's not completely visible (similar functionality as in Visual Studio). How do I determine if the length of the text string is larger than the current width of the status bar panel? I currently use Graphics.MeasureString method, but results are not consistent.
Thank you in advance
|
|
|
|
|
Results are not consistent because of different font types.
You might like to use system font.
- ashish
|
|
|
|
|
Somebody was telling me that Steve Ballmer(sp?) said that the .net platform wasnt going the way that MS wanted it to go and that it wont be around for much longer.
Anybody else heard anything about this?
|
|
|
|
|
Daniel1324 wrote:
Anybody else heard anything about this?
Nope.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
.Net is here to stay. Need some alternative to Java.
|
|
|
|
|
Daniel1324 wrote:
Somebody was telling me that Steve Ballmer(sp?) said that the .net platform wasnt going the way that MS wanted it to go and that it wont be around for much longer.
Anybody else heard anything about this?
Somebody is winding you up. .NET is here to stay. The new WinFx framework is built on-top of the current .NET implementation. C#, managed code and all the other goodies that came with .NET are continuing to evolve and are now central to Microsoft's developer strategy.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|