|
Hi i know one thing about .doc and .txt formats.
each format are differ by the formatting the contents. Actually word document also having the foemat char, and some special char for new line etc.
ok,
i thing that system having authering information for MS-Office so u need to know the authering details of that MS-Office authendication.
yours.,
ranandbe
|
|
|
|
|
i want to encrypt a string then write to a file.
and then decrypt to show. how can i do.help me plz.
|
|
|
|
|
Find a sample in your VS2003 directory.
C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\QuickStart\howto\samples\cryptography\fileencrypt\cs
|
|
|
|
|
Is there any way I can set something in the project, or call a method on startup, that makes my console app start with the console being hidden? I know I can use command-line switches but I'd like to be able to control it myself.
My program is actually a window-based app, so the natural thing would be to use a Windows Application, but I need to be able to use any GUI API, not only WinForms. So, the hidden console should start up the GUI part whatever it is.
TIA
|
|
|
|
|
If you change the output type to Windows Application you are not forced to show any windows forms. Just omit the (normally designer generated) Application.Run call and your program acts like a console one (just without a console window).
|
|
|
|
|
That simple..! I was prepared to do some ugly stuff; this made my day, thanks!
|
|
|
|
|
Hi,
While i am trying to access ActiveX control in C# i am getting this exception
{"Exception of type InvalidActiveXStateException was thrown." }
whats the issue..
|
|
|
|
|
Hi folks!
Now i use the DirectX.Capture.dll to capture the live video from cable. i got one problem is to set country code to the tuner in the Autotune progress.
i know the option for this by use DirectX.Capture.Propertypage collection but it will display the TV Tuner property window but i want only that componant.If any one know about plz share with me.:->
ranandbe
-- modified at 5:40 Wednesday 24th May, 2006
|
|
|
|
|
Hi,
Is there any way to use a specific string as a variable name? I'm having multiple textfields in my program and it would be pain in the butt to edit them all separately, they have been named sort of progressively: txtMonday1,txtMonday2,txtTuesday1, txtTuesday2, etc. And I would like to copy a certain number value to all of the boxes I want it to be copied to.
private void btnCopyWeek_Click(object sender, EventArgs e) {<br />
try {<br />
double copynumber = double.Parse(this.generalAmount.Text);<br />
for (int i = 0; i < 5; ++i) {<br />
for (int k = 1; i < 3; ++k) {<br />
string day = "txt" + WeekDay(i) + k;
((TextBox)day).Text = copynumber;
}
}
}
catch(Exception x) {<br />
MessageBox.Show("Not a number!\n\r" + x.Message);<br />
}
}
private string WeekDay(int day) {<br />
string[] days = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };<br />
return days[day];<br />
}
Any ideas?
-- modified at 4:14 Wednesday 24th May, 2006
|
|
|
|
|
One way to do it is by using reflection.
FieldInfo fieldInfo = this.GetType().GetField("YourTextBoxVariableHere", BindingFlags.Instance | BindingFlags.NonPublic);
if (fieldInfo != null)
fieldInfo.SetValue(this, "Your Text Here");
The other way would be to iterate through all the controls in the form and compare the name property to the string you generate. Depending on the number of controls in your form, this might perform better than the previous approach.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks, I tried the latter one out and it worked very well. I made it into this kind of method:
private Control FindBox(string text)<br />
{<br />
Control[] Controls = GCS_Payroll.ActiveForm.Controls.Find(text, true);<br />
return Controls[0];<br />
}
I'll try the first one too, just to get the idea.
|
|
|
|
|
u can use an array for TextBox.
TextBox textBox[];
|
|
|
|
|
I could, but the problem is that there are 14 predefined textboxes and I wanted to make a handy method to pick the right text box. Had I used an array I would have had to either pre-fill it with the aid of earlier example or fill the array with hands.
The first choice would make pre-fetching bit longer, but then I could just pick them up from array and be happy.
Thanks, for suggestion.
|
|
|
|
|
In a project, I have 1000 forms. guess you have a string contains a name of a random form. How can u show this form?
strFormName ="frmForm274";<br />
<br />
<br />
???any method like this ???<br />
???Form fx= GetForm (strFormName); ???<br />
???fx.show();???
I aim this for ToolBar Items. I have an Table at database.Table contains Form names. User Selects which buttons will be shown.then when user login to program, i read users toolbaritems, add them to toolbar.But i have to write some code to activate click event to show form.
|
|
|
|
|
1000?!?!??!
You can go with reflection:
Form form = (Form)Type.GetType("frmForm274").GetConstructor(new Type[0]).Invoke(new object[0]));
This code surely would create a new form everytime it is called. If you want to reuse the forms then:
private HashTable _formsHash = new HashTable();
public Form GetForm(strFormName){
if (!_formsHash.ContainsKey(strFormName)) {
_formsHash.Add(strFormName, Type.GetType(strFormName).GetConstructor(new Type[0]).Invoke(new object[0])));
}
return (Form)formsHash[strFormName];
}
But be careful that holding 1000 forms in memory might become a resource problem .
Just out of interest: What are those 1000 forms for? And who built them?
|
|
|
|
|
u get me wrong.
none of the forms at cache.
A solution consist of 12 seperate projects.
all forms count is about 1000.
there is one Main MDI Form Project, others are dll including forms.
I wanna add a toolbar to mdi form. But i would like to make it customize by user.
Each user can add his/her own short cut buttons to toolbar. Think i use Vs.net envoirenment with just "Standart" and "Layout" toolbar. I can add or remove buttons to each toolbar. In my project I wantto use just one toolbar. And user will choose his/her buttons. I add them to toolbar after login proses. When adding, i must add handler to all buttons. when user click a button, i have to create instance of form which belongs to that button then show.
|
|
|
|
|
Assuming all assemblies are already loaded the first line I posted will do the job:
Form form = (Form)Type.GetType("frmForm274").GetConstructor(new Type[0]).Invoke(new object[0]));
|
|
|
|
|
I'm a starter
How can I create a DBApplication on my Handheld?
How can i Connect to Sql server on my Lan network?
Rezak
Rojin to future
|
|
|
|
|
i can not know how to use App.config, how get value in that.
plz help me.
|
|
|
|
|
u can try
ConfigurationSettings.AppSettings["key"];
key is the string assigned to key tag in app.config file
rahul
|
|
|
|
|
If you are using Visual Studio, just right click on the project, click Add New Item and select Application Configuration File in the Utilities folder.
To create custom key/value pairs, just add something like this
<appSettings>
<add key="yourkey" value="yourvalue" />
</appSettings>
To use it from code, just do
System.Configuration.ConfigurationSettings.AppSettings["yourkey"];
Does this answer your question?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thanks for ans.
i will try it.
|
|
|
|
|
i add App.config but my project can not found that show Exception NameSpace.
but i add that item. and the file is still in the project directory.
plz help me.
|
|
|
|
|
yes at last i am success. and thanks a lot to u.
|
|
|
|
|
Hi All,
Can any one give me the suitable functions for the following in c# :
1. To find first instance of a file name that matches the file specification like *.jpg? like _tfindfirst( ) function in vc++
2.To find the next name, if any, that matches the file specification? like _tfindfirst( ) function in VC++
3. To find the Sub Directory? like _A_SUBDIR( ) function in vc++
4. To ignore directory with . and .. ?
Thanks
|
|
|
|