regarding the application size hi , i have been in the development of Smartphone game applications. after the creation of the setup file for my application , the size of the setup is around 500 KB . is dis creates any problem, or it is ok to run on the device . thanks sadiq Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Is this possible in C# or in any other language? I have a class B which is derived from class A. I also have one more class C which is unrelated to A & B. How can I access all the data of C from an object of B Is it possible without interfaces Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Very basic question Hi,
Can anyone explain the below given pattern of using if-else
Code Snippet
bool disposing = false;
if(disposing)
{
do something;
}
if(!disposing)
{
do something;
}
How is above given snippet different from the below one
Code Snippet
bool disposing = false;
if(disposing == false)
{
do something;
}
if(disposing == true)
{
do something;
}
This may seem silly, but I'm not understanding this. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Can you create options dialogs like in most Windows programs? Is there a way to pop up an options box in a program that will "freeze" the program like most windows programs do When you open the options dialog in Word, for instance, it will not let you get back to word document without hitting ok or cancel. If you try to click back to the document, the program will bing and the window will flash. Also, the window always stays on top - which is a nice feature. I would like to include something like that in my program and have no idea how. Any help would be greatly appreciated. Thanks! Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
File I/O Question- How to check if file is still being copied I have an application that I am writing that actively monitors a folder for video files. When a video file is inserted into the folder the program then takes that file and converts it to my desired format, outputting it to a separate directory. Now, if I start my application with video files already in the folder it converts them, no problem, and begins monitoring the folder for new video files to appear. The problem is, every now and then the program will try to begin the conversion process while a video file is still being copied into the folder from an outside destination. Is there an easy way to check to ensure that the video file is fully copied and the video conversion process is ok to begin The only thing I can think of doing is re-checking the video file size on every timer tick and if the video size matches the first value read then begin converting. Any thoughts on this are greatly appreciated. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Run Windows Application From Windows Service? Hi,
I have made a windows service that has a timer checks for a certain time to remind me. Now the time is reached so i want the service to display an alert!!
I have made a windows app that shows the alert but when i run it from the service it runs but not GUI displayed!!!
I can see it runs from the Task Manager but i cant show the form.
So is there any way to dispay i GUI alert from a windows service
Thanks a lot Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
List<> casting I have one property, this receive a object, ArrayList or List<>. How i can get the first item in this list In Array work's perfect, but, in List<> i don't know how to procced. See the code: private object pDataSource; public object DataSource { get { return this .pDataSource; } set { this .pDataSource = value ; if ( value != null ) { if (value.GetType().IsArray) { this .SelectedObject = ( value as object [])[0]; } if ( value . GetType ().IsGenericType) { Type t = value. GetType (). GetGenericArguments ()[0]; List <t> list = ( value as List<t>); //this don¡¯t work!!! this .SelectedObject = list[0]; } } } } Thank's in advance... Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
How To Get Excel Object From Process? Hello, Using following line i got all running Process/Instance of Excel : Process .GetProcessesByName( "EXCEL" ).
But after this i don't know how to get object from process/processid. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
simulating hardware Hi All I want to know if there is any useful links that can help in building a hardware simulator using C#, if you know a place where I can get information, plz help thx Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Problem with C++ to C#? Hello, I have tried to realise the functionalities of an c++ program in a new c# application. So I built a dll from this c++ program. But I found that this C++ program uses another C library, and one of their methods can not be executed correctly, if it is indirectly called by C#. For example: MyCPP . cpp is the C++ program which I want to develop in C#. MyCPP . cpp has a parameter(Object) MyInterface ( MyInterface . cpp ). In the constructor of MyInterface . cpp a function " AdsOpenPort ()" from a C library ( TcAdsAPI .h + TcAdsDef+.hTcAdsDll.lib) will be called. Everytime when I run MyCPP , the function " AdsOpenPort ()" will be called without any problem by the initialization. Then I wrapped this MyCPP . cpp to MyCPP . dll . But the process will freeze by calling " AdsOpenPort ()", when it is called in the C# application. I had thought that they should be same to call a C++ executable program or to call the dll which is developed from it. It is impossible for me to know the source code of " AdsOpenPort ()". Is there any other way to solve this problem Thanks in advance! Le Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Recursive function error Hello,
I wrote a function to that reads a file in a folder and then does something. the function is recursive in case of subdirectories. just like that:
public void ProcessDir( string sourceDir, int recursionLvl)
{
TextWriter tw = new StreamWriter (textBox2.Text + "\\FileNamesGen.txt" );
HowDeepToScan = domainUpDown1.SelectedIndex;
if (recursionLvl<=HowDeepToScan)
{
// Process the list of files found in the directory.
string [] fileEntries = Directory .GetFiles(sourceDir);
foreach ( string fileName in fileEntries)
{
// do something with fileName
tw.WriteLine(fileName);
}
string [] subdirEntries = Directory .GetDirectories(sourceDir);
foreach ( string subdir in subdirEntries)
if (( File .GetAttributes(subdir) & FileAttributes .ReparsePoint) != FileAttributes .ReparsePoint)
{
ProcessDir(subdir,recursionLvl+1);
}
}
}
}
so when the function recalls itself, this line
TextWriter tw = new StreamWriter (textBox2.Text + \\FileNamesGen.txt ); generates an error because it's still used by another process.
so i guess i shoul place the decleration of "tw" outside the function. but then i can't find "textBox2". any solution for this
ps: if you found an error in the code don't bother, i still didn't test it. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
C#, IComparable interface Hola!
I tried working on IComparable interface in the follwoing code snippet, it's working fine! But I don't get how the method 'public int CompareTo(object ob)' in Myclass returns 0
What is the value of v, or for that matter x I think x is assigned to v in the constructor, which isn't called perhaps to avoid compiler warning And x has its default value 0
But how the value of 'v - ((MyClass)ob).v' is 0 or otherwise Please explain.
using System;
class MyClass : IComparable { int value;
public MyClass(int x) { v = x; }
public int CompareTo(object ob) { return v - ((MyClass)ob).v; } }
class MainClass { static bool isIn(int np, int[] narrayp) { foreach(int n in narrayp) if((n.CompareTo(np)) == 0) return true; return false; }
static void Main() { int[] narray = {1, 2, 3, 4, 5};
if(isIn(2, narray)) Console.WriteLine("2 is in narray"); else Console.WriteLine("2 is not in narray");
if(isIn(22, narray)) Console.WriteLine("22 is in narray"); else Console.WriteLine("22 is not in narray"); } } Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Move objects between System.Collections.List Hi! I have two Lists (System.Collections) and I want to move (or copy) objects from the first to the second one. This is my code for(int x = 0;x < list1.Count;x++) { list2.Add(list1[x]) } But every time C# gives this error: Object reference not set to an instance of an object. How can this problem be resolved Thank you! Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
[Question] View value of a database on a label I had created a data base on visual c# (i had installed sql server 2005) and now i a few questions:
-How can i change a label text to a database value For example:
labe1.tex = "Value on Database X, Table Y, Row 3, collun 1"
-How can i add a new value on a collun
-How can i remove a value on a collun Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
BitArray Constructor ? Hello,
I will try to explain me in English¡
So, i use BitArray :
byte [] Alarm = new byte [1];
Alarm[0] = 0xff;
BitArray b = new BitArray (Alarm[0]);
=> Size of b : 8 bit
But if i make this :
byte [] Alarm = new byte [1];
Alarm[0] = 0x01;
BitArray b = new BitArray (Alarm[0]);
=> Size of b : 1 bit.
I do'nt understant this.
Could somebody explain me
Thanks.
JOOP. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Beginner in need of urgent help!!! static problems ok so here's the situation.. I have Form1 where i have textbox1 and where i declared it as static so that it can be accessed outside Form1 then I have Form2 where i have a button that appends some text to textbox1 in Form1. but when i look at the designer in the IDE i notice that textbox1 is not there anymore. but when i de-static textbox1, it shows up in the designer but then i can't access it on Form2 cause its not static anymore.. help pls Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Enterprise Library VERSION 1 in a .NET 2.0 WebSite... I get an error parsing the configuration file @ the highlighted line, and I can not run the WebSite. Is there ANY alternative other than having to do a major upgrade to use the latest configuration constructs
N
Code Snippet
< enterpriselibrary.configurationSettings xmlns:xsd = " http://www.w3.org/2001/XMLSchema " xmlns:xsi = " http://www.w3.org/2001/XMLSchema-instance "
defaultSection = "" applicationName = " Application " xmlns = " http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration " >
< configurationSections >
< configurationSection name = " ConfigSettings " encrypt = " false " >
< storageProvider xsi:type = " XmlFileStorageProviderData " name = " XML File Storage Provider " path = " Settings.config " />
</ configurationSection >
</ configurationSections >
< keyAlgorithmStorageProvider xsi:nil = " true " />
</ enterpriselibrary.configurationSettings > Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
How to make files copied using pre-build copy command get used in Setup project I have the following pre-build commands:
copy "$(ProjectDir)$(ConfigurationName).appSettings.config" "$(ProjectDir)$(OutDir)appSettings.config" /Y
copy "$(ProjectDir)$(ConfigurationName).databaseConfig.config" "$(ProjectDir)$(OutDir)databaseConfig.config" /Y
Which copy environmental specific config files accross to my output directory. E.g.
if working in localhost, the localhost.appSettings.config gets copied accross to bin/localhost/appSettings.config. This is so my single app.config can just reference the right sections using configSource="" but have the files physically vary depending on the kind of release
This all works fine, but how do I make it work in conjunction with a setup project
When I look at the primary output for the project it shows my exe and app.config file but not the two new files. How can I reference a file using this tool that it wont know about until build time Should I try some way to write some commands to copy to the setup directory as well
Thanks. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
know if a file is in use Hello,
I'm trying to write a file and my program fails because the file is in use.
I get the following error:
Could not write to output file 'c:\temp\MyFile.txt' -- 'The process cannot access the file because it is being used by another process.
Is there a way I can avoid this error, and ask before trying to write the file if it is in use or not
Thanks, Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
c# boxing question I have a question regarding boxing in c#. Currently, I have the need for a map like the following:
Code Snippet Dictionary<string, FieldValue>
Where field value looks something like this (i'm leaving out obvious code ):
Code Snippet struct FieldValue { public object DataValue {...} public UnitType Units{...} }
It has come to my attention that the majority of values I will be storing in this map will be value types, and I will be performing quite a few adds per execution of this program , so I would like to avoid some of the boxing penalty of storing value types in the DataValue parameter of the above object. Initially I thought, since I know all values will be either a number, a string, or a list of either type, that I would simply create 4 different fields, one for each type and store an enumeration that indicated which field was being used. I don't really like this solution, so another idea I had was to do something like the following (all value types will be stored in doubles):
Code Snippet class DoubleReference { public double DoubleValue{...} }
That way the DoubleReference object could be instantiated beforehand and I think, if I understand correctly how things work, that I would be able to avoid at least an unboxing operation by storing DoubleReference rather than a regular double in the map of generic object types. My question is, does doing this make any sense Will it gain me anything at all, or am I wasting my time here Thanks in advance for any help. Mike Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
How to find the folder or file path dynamically? Hi..
I needed to access the folder name in which the user has selected. For this i tried the FileInfo method. This is the code i tried:
FileInfo fi1 = new FileInfo (path);
txtDocName.Text = fi1.Name;
But i need to get the path of the folder or file which the user selects. so here i cannot pass the path as static one. How to provide the folder or file path dynamically Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Question on where to uninstall Code Snippet? Hello,
I have a question on Code Snippets.
I installed a snippet by this way:
1.Put a folder in C:\TestSnippet with snippet files
2.In the registry I add a new key under HKLM\Software\Microsoft\VisualStudio\8.0\Languages\CodeExpansions\CSharp\Paths call mySnippet with value ¡®C:\TestSnippet¡¯
Then in the Code Snippet Manger there will be a snippet item called TestSnippet .
However when I remove this key in the registry and the folder with files.
In the code window, when I right click Insert Snippet¡ , the TestSnippet is still there but it does¡¯t work because there is no snippet files.
I want to know that if there is a file or something that buffer the snippet.
By the way , I know that we can use Remove in the Snippet Manager to remove the snippet you want.
But because I add the snippets during the installation(setup not vsi file), and I want to uninstall the snippet by the uninstallation.
Is there any command line for this uninstallation
or is there any arguments for devenv on this
Do me a favor.
Thanks. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
OutOfMemory question While messing around with some of the new C# 3.0 features, I wanted to see how many ulongs I could fit in a collection. To my dismay, it threw OutOfMemoryException long before I thought it would! Why isn't my program eating up more RAM before it craps out I'm only getting about 256MiB of RAM used up, even though I have over 3GiB.
static class RAMTest
{
static void Main()
{
ulong initialMember = 0;
ulong numberOfMembers = 100000000000000;
Console . WriteLine( "Attempting to generate a {0} collection with {1} members.." ,
initialMember . GetType(), numberOfMembers);
Console . WriteLine();
Console . WriteLine( "Successfully generated {0} members" ,
GenerateMembers(initialMember, numberOfMembers, n => n + 1) . Count);
Console . ReadKey();
}
public static Collection < T > GenerateMembers < T > (T initialMember,
ulong numberOfElementsToGenerate, Func < T, T > nextMember)
{
Collection < T > memberCollection = new Collection < T > () { initialMember };
for ( ulong i = 0; i < numberOfElementsToGenerate; ++ i)
{
try
{
memberCollection . Add(nextMember(memberCollection[memberCollection . Count - 1]));
}
catch (System . OutOfMemoryException )
{
break ;
}
}
return memberCollection;
}
} Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Is this a 'bug' in V.S.? I'm using Visual Studio 2005.
I've been working on a C# WinForm app and testing as I go to make sure the changes I enter are working. Today, I entered six lines and when I tested, I'm seeing the code perform a method that is not being called for. I'll try to explain;
In a method that sets the 'Enable' property of the form's command buttons, i have entered code:
private void SetButtons( bool btnAdd, bool btnEdit, bool btnDelete, bool btnCanc, bool btnSave, bool btnClose )
{
this.buttonAdd.Enabled = btnAdd;
this.buttonEdit.Enabled = btnEdit;
this.buttonDelete.Enabled = btnDelete;
this.buttonCancel.Enabled = btnCanc;
this.buttonSave.Enabled = btnSave;
this.buttonClose.enabled = btnClose
}
The above method is called like this: SetButtons ( false, false, false, true, true, true );
Before adding the lines to the form, the 'SetButtons' method would set the Enabled property of the buttons and return. However; now the execution proceeds to the buttonDelete' line and instead of setting the property of the button, execution drops 156 lines down in the code and starts to execute a method that is not in the 'Set' commands.
I've never seen this before and I'm at a loss as how to proceed. So far, I've re-coded the SetButtons method; I've Built and Re-Built the solution; and as a last resort, I've closed the solution, exited the V.S. IDE and restarted; nothing has worked, the code still tries to execute the same method 156 lines past the 'SetButtons' method.
I would really appreciate any information about this anomoly and how to correct it.
Thank you;
rhubarb Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
How to add Zero to an integer value from left (like 999 to 0999) hello, any body please tell me how to add "0" to an integer from left i just want to make my value 999 to 0999 and i tried with converting it to strings but after adding zero i have to make the string to integer again because my method accepts integers onli. thanks in advence ranadheer Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Employing Visual Studio 2005 IDE I would like to employ the Visual Studio 2005 IDE as the structure for the GUI of my program. I've seen other programs harness the VS2005 IDE such as Textpad 5 (www.textpad.com), and the Sql Server Management Studio for Sql Server 2005. How can I do this Is there an SDK for building software using the VS2005 components, or am I able to reference .NET or COM dll's Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
creating a sprite from a file picture I have spent over 4 hours trying to figure out how to create a sprite from a picture. I have a programming background of turing I know a little bit of visual basic. I can't understand how to load a picture. Any help is appreciated. Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Using .lib files in C# Hi there, I am facing problems in using .lib files in C#. One of my friends made .lib files using C++.NET and I want to use these libraries in C#. Does anyone know how to do that Regards Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Compare two text contents in C# I have a trouble !
I have a two string, something like this:
string requestOne = "Hello, I'm from Canada and pleased to see you";
string requestTwo = "Hello, I'm from Viet Nam and my name is Bac";
and now I want to compare two strings and value returned is a percent of the same !
string requestOne = " Hello, I'm from Canada and pleased to see you ";
string requestTwo = " Hello, I'm from Viet Nam and my name is Bac ";
the italic text is the same ! But the bold text is difference ! We can't use String.Compare here !
And value returned is about 35% !
How to do this and what is a criteria Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
determine windows version hi
how can I determine the windows version that my application is running on I have defferent algorithems agianst deferent versions. epecially windows xp (embeded) and windows CE Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
An array of delegates[] Good evening,
Problem : I have a class with various methods in it. I have a bulk of text that i would like to perform certain actions on, however these actions must take the form of a sequence or an order.
E.g.
1. Extract all instances <IMG> then
2. Extract all <TABLE then
3. Extract all <SCRIPT> then
4. Extract all instances of "XXX" then
I have methods for all of these actions, however how would i go about recording the order in which a user decides to run these actions and then execute the methods afterwards in the selected order. I am leaning towards an array of delegates.
i.e. When a user selects "Extracts all instances <IMG>" a delegate is added to a "process" array of delegates with the delegate name. Can someone confirm that this would work or suggest an alternative method.
Many thanks
Martin Tuncaydin
martin@agentfactor.com Tag: Visual C# General Create app that has a life of only 10 days? Visual C#
Evan Mulawski
Is it possible to use TimeSpan and/or Settings to create an app that has a life of 10 days
Re: Visual C# General Create app that has a life of only 10 days?
OmegaMan
Sure why not The issue is saving off the start date to a registry entry and extracting it during start up. You may want to check out the starter kit Shareware Starter Kit which may give you some ideas on doing such operations.