|
Set Autosize = False, set the size you want, set ImageScaling=None
|
|
|
|
|
hi!
i am developing a web base application using c#.net with SQL 2005. In my web site i am facing problem in creating Directory structure. i am confused that how to creat directory structure in web base application. I have a little idea to creat directory structure in window base application but in web base i cannot be doit. please help me if any body can. please...
Hoping for good response.
|
|
|
|
|
We have an ASP.NET forum. Using server.mappath to get the root is the only extra step you need to create directories on your server. Of course, you cannot create directories on the client with ASP.NET.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I'm creating a simple chat application so I started programming with the user interface. Ok here's how I did my layout, I have a split container in a horizontal orientation. The panel that is above the split container has a rich textbox where output or messages pops out including the user's messages. The panel that is below the split container also a rich textbox where the user enters the message. Whenever the user has finished typing the message, they hit the ENTER key, and then the message pops out in the rich text box that is above the split container. After hitting Enter, the rich textbox(input) should be cleared out which was not a problem. Here's the problem on that textbox, after clearing rich textbox, THE I-BEAM pointer should be pointing on the FIRST LINE... well it doesn't after I clear the rich textbox it is still pointing on the second line. Is there a command that I can CONTROL the I-BEAM pointer to POINT on the first line? or is there any other way around?
|
|
|
|
|
Can you please post your code?
|
|
|
|
|
well.. i can't post the full code cause its going to eat the whole page. Anyways, here's a code snippet of what i've done on clearing the rich textbox.
richTextBoxInput.clear();
|
|
|
|
|
Hi, I am trying to convert some of my BlitzBasic code over to C# and I cant get the following statment to work?
Blitz:
If paletteRmap[i]=0 And paletteGmap[i]=0 And paletteBmap[i]=0
C#:
If (paletteRmap[best]=0 & paletteGmap[best]=0 & paletteBmap[best]=0)
Error Message
The left-hand side of an assignment must be a variable, property or indexer?
Thanks.
|
|
|
|
|
You are looking at the wrong operator for the error. The equality comparison operator in C# is ==, not =.
However, you probably want to use the regular && operator that does short-cut evaluation, instead of the & operator that always evaluates both operands, regardless if it's needed to determine the result of the operation.
if (paletteRmap[best] == 0 && paletteGmap[best] == 0 && paletteBmap[best] == 0)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
And = &&
Or = ||
nelsonpaixao@yahoo.com.br
|
|
|
|
|
And = & (bitwise 'and')
Or = | (bitwise 'or')
AndAlso = && (logical 'and')
OrElse = || (logical 'or')
You'll get into problems replacing the bitwise 'And' and 'Or' operators with the logical && and || operators. Conversion problems from VB are caused by the fact that many VB programmers misuse 'And' and 'Or' as logical operators (they will function as non-short-circuiting logical operators, but are designed to be bitwise operators).
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
I wrote a small program and finished it (or so I think. I am sure bugs will show up). I am havinf a problem though. I need to reverse the "copy to output directory" feature. I always end up with the same db each time i load.
modified on Sunday, August 10, 2008 4:26 PM
|
|
|
|
|
Right click on the file in the solution explorer and view the properties. There you can control if the file should be copied or not when you compile.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all, I'm looking for just some ideas, not really specific implementation (although, if you feel like sharing that I'd be thankful).
I have a folder with a very large number of pictures (around 10,000). None of these images are particularly big (about 50 to 100KB each)
My application views these images, 5 at a time, depending on what the user chooses. To be more clear, the images are of various species of birds. For each species there can be 5 to 10 images and, in the application, when the user selects a species, it displays all the images of that species.
I'm using the filenames to identify the species and if a certain species is selected I find the applicable files from the folder by using Directory.GetFiles() matching the relevant file names.
This is the first thing I would like to change. I would imagine that a DB implementation of sorts would be more efficient. I like MySQL and have some experience with it (although not in C# seeing as I'm fairly new to C#). Would MySQL be a reasonable choice or is there anything else I should consider if I want to keep the costs of the final product minimal?
Should I save the images as BLOBs in the DB or should I rather save them to disk and save only the file names to the DB?
Secondly, and this is where I really don't have much of a clue. I would like for the images not to be accessible to the end user, ie. this idea of having a folder on disk with 10,000 images. Is there a reasonable way of putting all of the images in a single file perhaps and have the application extract it from the file as needed? The file would be bg (we're talking of up to 500MB), would that pose significant problems to the operation of my application? What might make this decision more tricky is the fact that I'd like for it to be possible and easy to add and remove images from this file at any time.
Any ideas and suggestions would be appreciated.
|
|
|
|
|
Especially considering that you don't want the files to be accessible by the end user and want to add/remove images at any time I'd go for the database solution.
You could create a thin image access layer and create several implementations that can be switched easily. Something like this:
interface ImageAccess
{
Image[] GetImagesForSpecies(string species);
AddImage(string name);
RemoveImage(string name);
AddSpecies(string name);
RemoveSpecies(string name);
}
On top of this you could create implementations based on file systems, a local database (like SQLite[^]) or a remote database (Oracle, MySQL, PostgreSQL, whatever) where you would have to specify the connection string.
The last solution would make the data changes transparent to the user, the client app wouldn't have to update itself. But the client needs to be connected to the internet.
The filesystem/local-DB solution would require some sort of update mechanism by the client application, but no internet connection would be necessary once all the data is loaded.
I would go for a DB solution (either local or remote) saving the species names and images in relations like this:
Relation species
ID | Name (varchar)
---------
1 | Species1
2 | Species2
3 | Species3
Relation images
ID | Image (BLOB) | Species (FK)
--------------------------------
1 | ... | 1
2 | ... | 1
3 | ... | 1
4 | ... | 2
5 | ... | 2
6 | ... | 3
7 | ... | 3
A nice side effect of using a local database like SQLite is that everything will be stored in a single file, not directly accessible by the user. (Although it would still be possible to extract the images using the SQLite command line tool)
hope this helps,
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Don´t use the load image from path way.
Use a database to store the images, that way only the uses that has acess to the db can see the images.
Download here some articles that show you how to store images in a db.
GoodLuck
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Hi,
I've got a program which runs on computer start-up. Is there some way to detect how the program has been opened?
For example;
If the user opens the program manually (clicking on the program .exe file), it creates a messagebox that says 'foo'.
Whereas if the program is opened by the computer at start-up it outputs a messagebox that says 'bar'.
something like:
if(openedby == user){
MessageBox.Show("foo");
}else{
MessageBox.Show("bar");
}
Just a simple example with, hopefully, a simple answer!
Thanks
|
|
|
|
|
You can send a command-line argument on start up to signal whether a user has ran it or not.
ie: if i run a file like "C:\myfile.exe /startup"
you would check it like this:
bool isUser = false;
string[] args = Environment.GetCommandlineArgs();
if (args[1] == "/startup")
isUser = false;
else
isUser = true;
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Thanks! That sounds brilliant.
I'm setting the application in the startup registry key like this:
rkStartup.SetValue("app name", Application.ExecutablePath.ToString());
can I just change it to this:
rkStartup.SetValue("app name", Application.ExecutablePath.ToString()+" /startup");
My computers old and I'm not particularly keen on restarting it to check as it will take forever
Thanks!
|
|
|
|
|
Okay, I've pretty much got it working (I've booted up my laptop to test it on).
I realised that I should surround the app name in brackets:
rkStartup.SetValue("app name", "\""+Application.ExecutablePath.ToString()+"\""+" /startup");
and it does run on start-up and does what it's supposed to do, but then it crashes It's just a 'program has stopped responding message'.. So I'm looking into that now.
|
|
|
|
|
DragenGimp wrote: and it does run on start-up and does what it's supposed to do, but then it crashes It's just a 'program has stopped responding message'.. So I'm looking into that now.
To debug, go to your project properties and click the debug tab. In the middle you see a box saying "Command line arguments:" add /startup in that box. What that does is, when you start your debugger (f5) it will start your application with that argument. Now you'll be able to see why its crashing.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Thanks.
What happens is it just stops working and it brings up an unhandled error: object was in a zombie state
now I've figured out that it doesn't crash until it reaches this line:
this.WindowState = FormWindowState.Minimized;
now I've got a check on resizing:
void MainFormResize(object sender, EventArgs e)
{
if(this.WindowState == FormWindowState.Minimized){
this.ShowInTaskbar = false;
notifyIcon1.Visible = true;
}else{
this.ShowInTaskbar = true;
notifyIcon1.Visible = false;
fetch_iniData("data.ini", true);
}
}
For some reason it is the:
this.ShowInTaskbar = false;
That is causing it to crash... I can't see why though.
The strange thing is that it's calling up the same function that is called on a button press, which works fine.. so why it works then and not when the application loads is beyond me
|
|
|
|
|
DragenGimp wrote: now I've figured out that it doesn't crash until it reaches this line:
this.WindowState = FormWindowState.Minimized;
That is real weird. I tried duplicating this issue but i couldn't break it I searched on google and didn't find anything useful. Hopefully, with the resize event everything is working now.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi,
I've been absent from my computer for a couple of days, but I seem to have fixed the problem.
I still have no idea why it was crashing, but I simply added this code:
this.ShowInTaskbar = false;
before I called up the minimise function and it seems to stop it from crashing. It's a fix, but I'd still like to know why it was crashing in the first place if anyone figures it out!
Thanks
|
|
|
|
|
Hey everybody
I wrote an application that for some reason has the following problem:
1. In some computers, everything works fine.
2. In some computers (most of them actually ), when visual studio is open (even when no solution is loaded), everything works fine. if we close visual studio the program start consuming 40%-50% CPU! if we run VS again, everything comes down...
Sounds a little bit like a VS Junkie , but I gotta put it in rehab!
Ideas ???
Thanks a lot in advance!
|
|
|
|
|
I need some help regd. dynamic instantiation of classes.
I have a treeveiw, which I populate at runtime by reading from an xml file.
When the user clicks a node, a class should be instantiated and the object is sent to another class.
The issue is, the tree can have any number of nodes and I have to create an object for each click and the class differs depending on the node clicked.(the name of the node is same as the class name that should be instantiated).
I have some basic knowlwdge of Generics.
Can anyone suggest a solution for this...
regards
indey
|
|
|
|