|
may be the data feched by ur application is huge so the processing time is much.
rahul
|
|
|
|
|
hi,
can i see code so i can figer out.
Thanks
Ali Zishan
London
|
|
|
|
|
|
-I have a picturebox 300*300 in size
-And a jpg 1200*1200 pixel 150 DPI
How to draw a quarter of image to picturebox with original size?
Thanks everybody
|
|
|
|
|
Not a quarter but a 1/16th.
How does the JPG exist? Is is a file, a Bitmap instance or what?
Regards,
Rob Philpott.
|
|
|
|
|
First thanks for answer.I load jpg to image object and draw a part of image(size=250*250) in picturebox.
Problem is image was draw in picturebox is smaller than i expect.(because i open jpg by ms paint and i saw 250*250 in ms paint is bigger 250*250 i draw in picturebox).
Hope you can explain.
Thanks.
|
|
|
|
|
Hmm. Not sure, although it sounds like a logical unit vs. device unit problem, possibly taking into account the DPI of your graphics set up.
My graphics card/monitor displays things at 98 dpi, so the scaling might be from the native 150dpi to the 98 (if you are the same), although I would expect things to be bigger than smaller in that case.
The DrawImage method of the Graphics class allows you to scale things, or the ScaleTransform method allows you to change the 'resolution'.
Regards,
Rob Philpott.
|
|
|
|
|
Thank for advise.I will research this problem.
|
|
|
|
|
Hi All,
I have developed an application in c# 2.0
I am going to launch my desktop application in market and I have 2 concerns regarding security of my application
1. Application licensing
2. database security
I don’t want anyone to use multiple installations of my application while he has paid me for 1 license and have a setup, how to prevent it?
I don’t want to show off my sql server schema while I have to deploy a database on client system with user id and password, how to attach an .mdf file with the sql server or anything else so that no one can check my sql database?
Hope you reply soon
Regards
Kaleem Ullah
|
|
|
|
|
LogiSmith wrote: I don’t want anyone to use multiple installations of my application while he has paid me for 1 license and have a setup, how to prevent it?
It is very tough to get a 100% perfect licensing system. I have used APIs from this[^] for my application. They are good and provide a decent way for managing the licenses and activations.
LogiSmith wrote: I don’t want to show off my sql server schema while I have to deploy a database on client system with user id and password
If you want to deploy the DB in user's system, it is very tough to secure it as user will have complete access to it and can hack in easily. Why don't you create a webservice which interacts with database located on your server and your applications interact with this webservice. So users will not have access to databases.
|
|
|
|
|
hi all,
when m modifying appconfig key it just doesnt save it
//my code
<appsettings>
<add key="T" value="True">
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings["T"] != null)
{
config.AppSettings.Settings["T"].Value = "False";
//config.AppSettings.Settings.Remove("DatabaseServer");
}
else
{
config.AppSettings.Settings.Add("Key1", "False");
}
config.Save(ConfigurationSaveMode.Full);
ConfigurationManager.RefreshSection("appSettings");
why is that happening !!!
|
|
|
|
|
Because you can't modify data in the app.config programatically. If you want user-specific data to be saved, you have to use the Settings object.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Your code works for me.
If you're looking for changes in your App.config, you're not going to find them there.
The changes are in the actual runtime configuration file named yourappname.exe.Config,
which will be in the same folder as the exe.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi everyone,now I have a winform Form1,in Form1,there is a TextBox1,and its Text is "abcd".
In the other project,I want to get the Text of TextBox1,as below:
Assembly assembly = Assembly.LoadFrom(@"ClassLibrary1.dll");
Type[] types = assembly.GetTypes();
FieldInfo[] fis;
System.Windows.Forms.TextBox tb;
for (int i = 0; i < types.Length; i++)
{
fis = types[i].GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
for (int j = 0; j < fis.Length; j++)
{
if (fis[j].FieldType == typeof(System.Windows.Forms.TextBox))
{
tb = fis[j].GetValue(Activator.CreateInstance(types[i]))as System.Windows.Forms.TextBox;
Console.WriteLine(tb.Text);
}
}
}
Console.Read();
But I have to create a instance "Activator.CreateInstance(types[i]))".Are there any ways that I can get the Text without create a Form1 instance?
Anyone who can help it would be appreciated.
|
|
|
|
|
Morven Huang wrote: Are there any ways that I can get the Text without create a Form1 instance?
Since the textbox is a member of Form1, you need to instantiate Form1 for getting access to text box.
|
|
|
|
|
That would be like asking for the colour of a car that doesn't exist. You know that cars have colours - but you the colour doesn't exist without the car.
|
|
|
|
|
|
Hai
Me with C#.net I want to make a text box to accept only numbers and decimal points(decimal point only once), so I tried to make a user control and is working fine except one problem. If if select all the data in the text box and try to enter a new value decimal point will not accept until I press the backspace. My user control code is a follows
string i;
int f;
public string Text
{
get
{
return NMTextBox.Text;
}
set
{
NMTextBox.Text = value;
}
}
private void NMTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
try
{
string numaric = NMTextBox.Text;
for (int j = 0; j < numaric.Length; j++)
{
char myChar = numaric[j];
}
if (NMTextBox.Text == "")
{
f = 0;
}
if (e.KeyChar.ToString() == ".")
{
++f;
if (f >= 2)
{
e.Handled = true;
}
}
if (i == "8")
{
f = 0;
for (int j = 0; j < numaric.Length - 1; j++)
{
if (numaric[j].ToString() == ".")
{
++f;
}
}
}
if (e.KeyChar.ToString() != "." && Char.IsNumber(e.KeyChar) != true)
{
if (i != "8")
{
e.Handled = true;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.StackTrace, ex.Message.ToString());
}
}
private void NMTextBox_KeyDown(object sender, KeyEventArgs e)
{
i = e.KeyValue.ToString();
}
Thanks & Regards
|
|
|
|
|
If InStr(sTotalRows, "TOP 100 PERCENT *", CompareMethod.Text) > 0 And Trim(sCondition = "") Then
'If db.Tables.Item(sTableName).Rows > 0 Then
db.Tables.Item(sTableName).ExportData(objBCPExport)
'End If
Else
Dim sSelectCommand As String = "select " + sTotalRows + " from " + sDatabaseName + ".." + sTableName
If Trim(sCondition) <> "" Then
sSelectCommand += " WHERE " + sCondition
End If
'Create a temporary view to hold data
Try
db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default)
Catch
End Try
db.ExecuteImmediate("create view Temp_View_For_Backup_001 as " + sSelectCommand, SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default)
db.Views.Refresh()
'db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCP)
'Export data to a file
db.Views.Item("Temp_View_For_Backup_001").ExportData(objBCPExport)
Try
db.ExecuteImmediate("drop view Temp_View_For_Backup_001", SQLDMO.SQLDMO_EXEC_TYPE.SQLDMOExec_Default)
Catch
End Try
End If
|
|
|
|
|
There are lots of tools for this, but I assume no one is perfect. Do it manually.
C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding
|
|
|
|
|
First just write in simple english what this code does and then think how to write that in C#
I think that's the simplest method
|
|
|
|
|
To Convert to C# from another Language you must Understand C#
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswam@its.co.za
|
|
|
|
|
How do made xml file that read or write in ?
|
|
|
|
|
Check this link[^]
Regards,
Lev
|
|
|
|
|
There are classes available and by using objects of those classes u can read/write in XML file
google it!
|
|
|
|