|
Because every time you do a complete rebuild of the application, the output directories get cleaned out. You might want to try putting the .INI file either in the application project folder or where the application can find it on the Path, like in the %WINDIR% folder, which, BTW, is not always C:\WINDOWS.
By putting it in the application project folder, this folder will not get cleaned out when you rebuild your project. If your code is written correctly, it will not assume that the current directory is whatever directory the app was launched from. Instead, your code should ask the system from what directory is was launched from, then look in the directory for the configuration file.
Check into storing Application.StartupPath and/or Environment.CurrentDirectory when your application starts and using it later to locate your configuration file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
I want to use the .exe.config file. I copied to the main project folder. Then also it is not reading the file. Please tell me from where all the application reads the exe.config file. Secondly, I created an .ini file also.
I copied .ini file to bin, debug and project folder. I set the project output folder to first to bin then to debug. But the problem remains.
please help
shelly
|
|
|
|
|
Dave Kreskowiak wrote:
Because every time you do a complete rebuild of the application, the output directories get cleaned out
Actually this is not true. I have multiple applications that have INI files in the Debug & Release directories and they are not effected in any way when performing any build type in the build menu of VS.NET. Are you talking about some action other than those in the build menu ?
|
|
|
|
|
how to make an area in the form have an opacity less than the hole form?
|
|
|
|
|
how to make users have the ability to make manual resizing for a rectangular or nonrectangular form only from one side of its 4 sides ?
|
|
|
|
|
)how to make users have the ability to make manual resizing for a nonrectangular From ?
|
|
|
|
|
Hi
I know the disk letter of USB Mass Storage Device.
I want to get such info as "Model", "SerialNumber" and etc for USB divece.
How I can detect the USB device (get ManagementObject or something like that)?
Thank you
|
|
|
|
|
Hi guys.. I recently downloaded this C# code generation tool at www.covalentia.net and its pretty cool.. thought i'd share it with you all... Happy programming
|
|
|
|
|
No advertising in the forums please! It's unprofessional... and cheap on your part.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
i have a VB Code to handle powerpoint presentations and need this code in C# but i have no idea how to manage this.
Can anybody help me please, need this very urgent for my work!
Thanks a lot!
Peter
Code in VB:
Sub copy()
ActivePresentation.Slides.Range.Select
ActiveWindow.Selection.TextRange.Characters(Start:=1, Length:=7).Select
ActiveWindow.Selection.Copy
ActivePresentation.Slides.Range.Select
ActiveWindow.Selection.TextRange.Characters(Start:=7, Length:=0).Select
ActiveWindow.View.Paste
ActiveWindow.Selection.SlideRange.Shapes("Picture 3").Select
ActiveWindow.Selection.ShapeRange.Delete
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.Delete
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 8").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 6").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.Delete
End Sub
|
|
|
|
|
|
Hi David,
thanks a lot for your fast answer.
I already use PIA, but the code is different in C# from VB6.
Since 2 days i try to "translate" this sample VB6-code to C# but i have no success.
I really become crazy with this problem.
Peter
|
|
|
|
|
ok. I think best you can do is to browse MSDN for examples...
You can post here result of you translation (if not long), maybe somebody can point out what's wrong or how to do it etc...
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Here is a function to copy from a presentation all elements and make a new presentation of it.
For each element of a shape a new shape is generated.
But the problem is that it loses all its formatting for the text, background,...
Perhaps anybody has an idea.
Thanks a lot!
Code:
public PowerPoint.Presentation GetPresentation(PowerPoint.Presentation pOriginalPresWithAnimations) {
PowerPoint.Presentation pNewPresWithoutAnimations = __pPPT.Presentations.Add(Office.MsoTriState.msoTrue);
string sName = pOriginalPresWithAnimations.Name;
string sPPTCopyPath = "PresentationCopy";
string sPath = System.Windows.Forms.Application.ExecutablePath;
sPath = Path.GetDirectoryName(sPath);
sPPTCopyPath = Path.Combine(sPath, sPPTCopyPath);
string sSlidePathName = Path.Combine(sPPTCopyPath, sName);
if(!Directory.Exists(sPPTCopyPath))
Directory.CreateDirectory(sPPTCopyPath);
if (File.Exists(sSlidePathName))
File.Delete(sSlidePathName);
pNewPresWithoutAnimations.SaveAs(sSlidePathName, PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, Office.MsoTriState.msoTrue);
foreach (PowerPoint.Slide pSlide in pOriginalPresWithAnimations.Slides) {
SlideInfo pSlideInfo = PresentationInfo.GetInfos(pSlide);
ArrayList pArrayFix = new ArrayList();
Hashtable pHashAnimiert = new Hashtable();
for (int i = 1; i <= pSlide.Shapes.Count; i++) {
__pShape = pSlide.Shapes.Item(i);
if (__pShape.AnimationSettings.Animate == Office.MsoTriState.msoFalse) {
pArrayFix.Add(__pShape);
}
else {
pHashAnimiert.Add(__pShape.AnimationSettings.AnimationOrder - 1, __pShape);
}
}
__pSlide = pNewPresWithoutAnimations.Slides.Add(__nFolienIndex, pSlide.Layout);
for (int j = 0; j < pArrayFix.Count; j++) {
__pShape = (PowerPoint.Shape)pArrayFix[j];
__pShape.Copy();
__pSlide.Shapes.Paste();
}
AddAllSlides(pSlideInfo, new SlideInfo());
for (int i = 0; i < pHashAnimiert.Count; i++) {
__pSlide = pNewPresWithoutAnimations.Slides.Add(__nFolienIndex, pSlide.Layout);
__pShape = (PowerPoint.Shape)pHashAnimiert[i];
__pShape.Copy();
__pSlide.Shapes.Paste();
if (i >= 1) {
for (int k = 0; k < i; k++) {
__pShape = (PowerPoint.Shape)pHashAnimiert[k];
__pShape.Copy();
__pSlide.Shapes.Paste();
}
}
AddAllSlides(pSlideInfo, new SlideInfo());
}
}
__nFolienIndex = 1;
return pNewPresWithoutAnimations;
|
|
|
|
|
Is there a c# equivalaent of the delphi WITH keyword? WITH allows you to set a scope for class variables in a function, so that the class need only be specified once then all variable names that match with variable names inside the class are deemed to be from the specified class. ie.
public class car
{
public int wheels;
public bool isSofttop;
}
public main
{
car Audi = new car;
WITH Audi do
{
wheels = 4;
isSofttop = false;
}
}
|
|
|
|
|
|
AFAIK no, there isn't equivalent to with . If you want to be 100% sure, google for ECMA-334(C# spec.) After quick glace into spec. there seems to be nothing similar to with statement.
Personally, I am happy about.
However you can use using to deal with namespaces. (which are often way much longer names)
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
The closest you can get to that is to use a temporary abbreviated variable:
public main
{
car Audi = new car;
car a = Audi;
a.wheels = 4;
a.isSofttop = false;
}
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
Hi ,
I want to filter the selected color from the image.I had already done the filtering the whole image with grascalling and making contrasting whole image but now i want to filter the image with selected color,Now i want to know logic for filtering the selected image.
here i am using the logic for contrasting the image (means filtering the whole image),now can anybody say how to deduct or filter the selected R,G,B value from the whole looping.Here i am describing whole loop which i am using for contrasting the image.
public void MakeContrastUnsafeFaster(int nContrast)
{
//Getting the how much pixel Arrays do you want to retrives.
Point size = PixelSize;
//Locking the bitmap for getting great performance
LockBitmap();
for (int y = 0; y < size.Y; y++)
{
PixelData* pPixel = PixelAt(0, y);
for (int x = 0; x < size.X; x++)
{
byte value = (byte) ((pPixel->red + pPixel->green + pPixel->blue) / 3);
// perform contrast enhancement here:
value = (value < 150 ) ? byte.MinValue : byte.MaxValue;
pPixel->red = value;
pPixel->green = value;
pPixel->blue = value;
pPixel++;
}
}
//Now Unlocking the Bitmap and making it free.
UnlockBitmap();
}
Here i am setting the R,G,B value with minimum and maximum value which bifercare my image into only black and white,
Now my requirement is that what to do in this logic by which only selected color dropped out?
anybody help into that?
|
|
|
|
|
How can one define a class in multiple files?
Sometimes there are classes with huge amount of code that wouldn't have sufficient reason for a hierarchy of classes (as the main class of a web service) but still are difficult to maintain because of the large amount of code in one file and even more difficult to be used by multiple developers in the same time. So, is there a way to span a class over multiple files?
Cheers
Dani
|
|
|
|
|
.NET 2.0 is supporting multiple files for a single class using the partial keyword in C#. You can read more about this feature in this article.[^]
On the other hand, if a class grows that large, I'd consider a review on the design.
hth,
Matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
|
How i can change system time in C#?
Nothing
|
|
|
|
|
|
I am building billing software in C#. I need to print bills at POS (Point Of Sale) and most of the time I am dealing with dot matrix printers like Epson LX 300.
Using normal c# printing procedures, after I am finished printing, printer automatically ejects the whole page. To save this, I have reduce paper size to few cm from printer page settings. In some cases, the associated driver like Epson LX 300+ doesn't let me set size smaller than 1 inch.
Is there any method in C# to print one line (or one char) at a time? For example - like when we print from command prompt
c:\>echo hello > prn
|
|
|
|