|
Thank you friend,
Thanks for Your replay ......
i made small mistake ....
i am not reading 2G file at time i am reading 100kb at time ...anyhow thanks for your suggestion.
thank you.
by
joe
|
|
|
|
|
IIRC it depends on 32 vs 64 bit.
But, in any case, will you really be happy if one program fills up all of most (or at least a sizable chunk) of your RAM?
Btw, surely you mean a long not a double
|
|
|
|
|
|
Hi,
AFAIK array sizes are limited to something like 2G-1.
However, assuming you only need part of the content of a binary (i.e. non-text) file, you can:
- get the File.Length, which is a long;
- get a stream for reading the file, with File.Open;
- seek a position in the file, say length-10, using FileStream.Seek;
- and read part of the file into an array, using FileStream.Read;
- finally close/dispose everything.
So for getting the end of the file, there is no need whatsoever to read everything!
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
|
Hi All ,
In my datagridview , i imported an excel file to analyse it so filter and etc. . after that I want to export it to an Excel File using Save As Button in Windows Application . Plz help me how can do it ... ?
Regards
s_mostafa_h
|
|
|
|
|
|
thanks,
this add all the contents of DatagriView , no the Header Text of column ,
....
RGDS !
s_mostafa_h
|
|
|
|
|
hi...
i tried to create a generic base class. create Form1 as base class. Tried to access form1 from form2. there is no error on build. but i cant view the design part of Form2. Design part shows the error
"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Form2 --- The base class 'Test2.Form1' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. Customer --- The base class 'System.Object' cannot be designed. "
source code is given bellow
public partial class Form1<T> : Form
{
public Form1()
{
InitializeComponent();
}
}
public partial class Form2 : Form1<Customer>
{
public Form2()
{
InitializeComponent();
}
}
public class Customer
{
private string customerName = string.Empty;
public string CustomerName
{
get { return customerName; }
set { customerName = value; }
}
}
please help me to solve this problem
---------------------------------------
Thanks in advance
|
|
|
|
|
Have you looked at an inherited form. Create you base form, compile your app. When you create your next form there is an option to create an inherited form and select the base form.
|
|
|
|
|
hi all,
i am in need of reading tasks from an .mpp file. How can i find the parent task id of particular task while reading? Please help me..
Lal
modified on Thursday, November 26, 2009 12:18 AM
|
|
|
|
|
Interop provides classes and interfaces to read an MPP file. There you can create a Task object and check if it offers any property to do this.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Dear all,
Can you give me code that can find form in MDIParent?
Socheat
|
|
|
|
|
Your question is not clear. Do you want to find a form that is child of a MDI form?
Best wishes,
Navaneeth
|
|
|
|
|
Dear,
I want to find form child, if it not yet open, it will open
Socheat
|
|
|
|
|
|
MDIChildren property of the parent form would give an array of child forms. Is this what you are looking for?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
|
This is the final code, i finally got the array in the label. Thanks
public partial class ShippingCosts : Form
{
int[,] intZip = { {33620, 5}, {33619, 10}, {33618, 12}, {33617, 13}, {33616, 14}, {33611, 18}, {33602, 22},
{33600, 25}, {33254, 26}, {33628,30}};
public ShippingCosts()
{
InitializeComponent();
}
private void btnSubmit_Click(object sender, EventArgs e)
{
int intZipCode=Int32.Parse(txtZipCode.Text);
for (int intcounter =0; intcounter <intZip.GetUpperBound(0); intcounter++)
{
if (intZipCode== intZip[intcounter,0])
{
lblResults.Text=Convert.ToString(intZip[intcounter,1]);
return;
}
else
{
lblResults.Text = "We do not deliver to this address";
}}
modified on Wednesday, November 25, 2009 8:43 PM
|
|
|
|
|
Hi,
I think it has to be Convert.ToString(intZip[intcounter,1]); to correspond to the conditional test on the line before it.
However there are better ways to do this:
1.
an array is fine when you know the number of elements in advance; otherwise you should use a list (good old ArrayList, or better yet the generic List<T> where T is some type).
2.
using a two-dimensional array like this is a little ugly. A clearer (but more expensive) way would be to create a class or struct that holds one ZIP code and one shipping quantity, then build a one-dimensional array or a generic list of such elements.
3.
and then, as you are interested in mapping one collection (ZIP codes) onto another collection (quantities), there is even better; have a look at the generic Dictionary<TKey,TValue> class. Using that, with its indexing capabilities and its Find methods, you could eliminate your for loop entirely.
4.
and finally some people will argue your data belongs in a database table, so you don't need a Dictionary, a simple SQL query would come up with the result.
PS: you have a strange return inside the if-else; I would expect both cases to be more similar, i.e. have
a return after the if-else (or none at all, if that's the end of the method).
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
your [0,1] should be [intCounter,1]
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Thank you very much guys, i knew it was something really dumb like that but i really appreciate the explanations.
|
|
|
|
|
Quick Answers giving an internal error so I posted here
1. Can any one spare the executable for July ctp of Parallel FX ? all links dead
2. Where you able to get the Parallel.for or any method of the Parallel extensions to work in VS2010 beta 2 (with .Net framework 4.0 beta 2). They say it is an added feature?
Thanks
|
|
|
|
|
Member 4277480 wrote: Can any one spare the executable for July ctp of Parallel FX ? all links dead
Reactive Extensions[^] has just been released and includes an ( unsupported ) back port for .NET 3
Member 4277480 wrote: Where you able to get the Parallel.for or any method of the Parallel extensions to work in VS2010 beta 2 (with .Net framework 4.0 beta 2). They say it is an added feature?
PFX is included in the .NET 4.0. The Parallel class is in System.Threading.Tasks and seems to work just fine
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Hi all,
Until some months ago, I had a tool that could log into this web: http://www.infojobs.net/empresa_login.cfm[^]
Using C# (desktop tool), i could login doing:
NameValueCollection postdata = new NameValueCollection();
postdata.Add("e_email", name);
postdata.Add("e_password", password);
postdata.Add("tipoLogin", "1");
byte[] data = webClient.UploadValues(new Uri(_loginPage), postdata);
After that, I saved the cookie and I could do other operations.
Buf since 3-4 months, this code doesn't work. I think they have changed the authentication process, but i'm not able to identify the changes. With firebug I can see that the login form is the same.
Does anybody know what have they modified?
Thanks in advanced.
PS: Sorry if this is not the place to post this thread. It's C# Code, but it's more a web problem.
|
|
|
|
|