|
did anyone tell you this is Lounge[^] material?
|
|
|
|
|
Yes, I already did.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
|
So that you guys can blame me for reposting.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi,
I have an application in C# using sockets and a pair of dll not .net based (I think they are ocx).
As I can't use these components because the sovket reception opens a new thread I have to use a new thread an fix the ApartmentState to STA. Inside this new thread I declare objects from this dll and if I open the task manager of windows I can see that the size in memory of the proccess increases a lot every time a new message is received.
I thought that the garbage recollector should make it for me but how can I free resources?
I'll try to set the objects to null but I don't know if this is the best solution (if it works,obviously).
Thanks in advance.
|
|
|
|
|
|
Thank you for your answer, I've tried both options and the result is the same. It continues growing in memory...
|
|
|
|
|
Can someone point me in the right direction. I want to create a folder and assign a icon to the folder I created so that the folder does not show a generic icon.
directory.create(...) will create the folder but I do not know in code how to assign a icon?
In windows I just change the folder to a system folder and modify the desktop.ini file.
|
|
|
|
|
I think you need to create desktop.ini file in your program.
|
|
|
|
|
See this[^] article.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hi everybody!
ok, I desperately need to make such thing:
There's a website, that have a form (with post method) and have 2 input fields. After a press of a button, on next page a table is generated, and it fills with numbers using ajax. So at the start table cells have this rotating gif "saying" that data is being collected, and after some time numbers appears.
So my question is how to get the source of the page AFTER all ajax events is being finished?
I have tried to use this method, and I had some strange results - one day it worked, next day it won't.
So, maybe there's another examples?
Thanks!
|
|
|
|
|
wrong forum -> ask at ASP.NET forum
|
|
|
|
|
why?
I am writing the program that retrieves the data from a webpage on C#.
|
|
|
|
|
i am developing a c# window application in which i have to give a functionality of Undo And SelectAll.how can we do this i have a MDI parent form and lots of MDI children In MDI parent form.Through MDI parent form i want to control this.
|
|
|
|
|
|
|
And also i have to give the functionality of cut copy paste ...i have the code but its not working inside the Group box or panel...
can u modified it ..
Private StringBuilder sb=null
private void CutCopyPaste(bool Cut, bool Copy, bool Paste)
{
foreach (Form f in this.MdiChildren)
{
if (f.ContainsFocus)
{
foreach (Control c in f.Controls)
{
if (c.Focused)
{
if (c.GetType() != typeof(Label))
{
if (Cut)
{
sb.Append(c.Text);
c.Text = "";
}
else if (Copy)
sb.Append(c.Text);
else if (Paste)
c.Text = sb.ToString();
break;
}
}
}
}
}
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
sb = null;
sb = new StringBuilder();
CutCopyPaste(false, true, false);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
if (sb != null)
CutCopyPaste(false, false, true);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
sb = null;
sb = new StringBuilder();
CutCopyPaste(true, false, false);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
|
|
|
|
|
Hi,
Do anyone know the formula for converting XY coordinates of Picture Box to Latitude and Longitude of Earth.
Thanks.
|
|
|
|
|
kjsl2k9 wrote: converting XY coordinates of Picture Box to Latitude and Longitude of Earth
what does it mean??
do you mean you need to apply Great Circle formula to the picturebox ??
Or you need to geocode the area that is shown in the picture.
If you mean the later, it is impossible...
|
|
|
|
|
First of all, you must know how to convert degree,minute,second to decimal and vice versa...
The next step, you must know, how big is your image (for example : 1000x1000 pixel)
Then you must know, which coordinate is the left, right, top and bottom side.
For example :
Image is
X = 1000 pixel
Y = 1000 pixel
Left = 0°
Right = 10°
Top = 0°
Bottom = 10°
That means horizontal at pixel 500 is (500*10)/1000 = 5°
and vertical pixel 300 is (300*10)/1000 = 3°
and so on...
|
|
|
|
|
Hi,
I had used the formula for calculating the Lat and Long by first calculating the dX and dY and then applying the following formula : -
public point XYtoLatLong(float X, float Y)
{
float Lat = LAT0 + dY * Y ;
float Long = LONG0 + dX * X ;
point pnt = new point(X, Y, Lat, Long);
return pnt;
}
where X and Y are the points of the picture box where the mouse is moved , Lat0 and Long0 are calulated as : -
delX = (maxLONG().LONG - minLONG().LONG) / (maxLONG().X - minLONG().X);
delY = (minLAT().LAT - maxLAT().LAT) / (minLAT().Y - maxLAT().Y);
lat0 = maxLAT().LAT - maxLAT().Y * dY;
long0 = minLONG().LONG - minLONG().X * dX;
maxLat and maxLong are used for getting the maximum Lat and Long
but the Lat and Long I am getting is giving the error of -0.00478 in Lat and +0.00389 in Long.How can I remove the Error.
Thanks
|
|
|
|
|
i have one doubt,
actually i have declared a string array
string ex = new string[3];
in a method i m returning string[10]. ie
private string temp()
{
string temp1 = new string[10];
}
ex= temp();
before calling this method my string ex size is 3, but after calling the method it size increased to 10..
is it possible how come?? actually at the starting itself we have allocated the memory as 3, how its getting increased??
can any one help me?
|
|
|
|
|
First of 'Hi Peoples' is not a valid title for a question - read the how to get an answer sticky at the top of the page.
You create a string , assign an array [3] then you assign a different array [10].
ex = temp()
is the same as
ex = new string[10];
What di you expect to get?
|
|
|
|
|
Hello. I'm having a problem using Text File. I'm using console application to put the data into the text file. When I try to use StreamWriter, it doesn't append the stream into the text file. I already tried some alternatives but still, it doesn't append the stream into the file.
Here is my code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.IO;
using System.Collections;
namespace VehicleRegistration
{
class Program
{
public static UserRegistration userReg = new UserRegistration();
static void Main(string[] args)
{
int totalDimension = 0;
string enteredName = "", enteredYear = "", enteredType = "", enteredPlate = "";
Registration(ref totalDimension, ref enteredName, ref enteredPlate, ref enteredYear, ref enteredType);
Console.Read();
}
public static void MainMenu(ref int mainMenu)
{
Console.WriteLine("VEHICLE REGISTRATION\n");
Console.WriteLine("MAIN MENU:\n");
Console.WriteLine("[1] - Vehicle Registration");
Console.WriteLine("[2] - Sort Database");
Console.WriteLine("[3] - Search Database");
Console.WriteLine("[4] - Exit\n");
Console.Write("Enter your choice: ");
mainMenu = Console.Read();
}
public static void Registration(ref int dim, ref string name, ref string plate, ref string year, ref string type)
{
string numDimension;
StreamWriter txtNames = new StreamWriter(@"E:\names.txt", true);
StreamWriter txtPlateNum = new StreamWriter(@"E:\platenum.txt", true);
StreamWriter txtType = new StreamWriter(@"E:\type.txt", true);
StreamWriter txtYear = new StreamWriter(@"E:\txtYear.txt", true);
Console.Write("Enter the total number of vehicles to be registered: ");
numDimension = Console.ReadLine();
dim = Convert.ToInt32(numDimension);
userReg.Dimension = dim;
Console.Write("\n");
for (int a = 0; a < userReg.Dimension; a++)
{
try
{
Console.Write("Enter the Last name of the owner: ");
name = Console.ReadLine();
userReg.NameOfOwner = name;
txtNames.WriteLine(userReg.NameOfOwner);
Console.Write("Enter the plate number of the vehicle: ");
plate = Console.ReadLine();
userReg.PlateNumber = plate;
txtPlateNum.WriteLine(plate);
Console.Write("Enter the type of vehicle: ");
type = Console.ReadLine();
userReg.TypeOfVehicle = type;
txtType.WriteLine(type);
Console.Write("Enter year registered: ");
year = Console.ReadLine();
userReg.YearReg = year;
txtYear.WriteLine(year);
}
catch (System.IO.IOException)
{
}
Console.Write("\n");
}
}
}
}
|
|
|
|
|
It looks like awful code, but nothing jumps out at me as being incorrect.
What problem are you having?
|
|
|
|