|
Yeah, Alan has just said too. But thanks for the response. Rookie mistake really, but sometimes it happens. The problem is that it appeared to work fine with other files so I didn't notice there was an error. It was just because Microsoft Word actually noticed crap at the end of the file that pointed it out. So hey, thanks to Microsoft too
Oh, can either you out Alan change the post to be an 'answer' so I can mark as answer please.
Thanks again, to everyone who took an interest
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
The use of the Stream reader and writer is a bit odd as you just want the underlying streams. To eliminate the possibility of the reader and writer internal buffers causing a problem you should open the file directly with FileStream.
e.g.
void Copier(String src, String dest) {
using (FileStream srcfile = new FileStream(src, FileMode.Open, FileAccess.Read)) {
using (FileStream destfile = new FileStream(dest, FileMode.CreateNew, FileAccess.Write)){
byte[] buffer = new byte[16 * 1024];
Int32 bytesRead;
while((bytesRead = srcfile.Read(buffer, 0, buffer.Length)) != 0 ){
destfile.Write(buffer, 0, bytesRead);
}
}
}
}
Alan.
|
|
|
|
|
Yeah thanks, this is what I had first (well I was using FileStream) but changed the types to test, StreamReader being the last I tried with... I'll change it back now
Thanks again
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I am using AT command to read sms from Mobile.
I am using 1> AT, 2> AT+CMGF, 3> AT+CSCS, 4> AT+CPMS, 5> AT+CNMI, 6> AT+CMGL commands to read sms. All are working. But when I try to execute the 1> AT command after 2/3 minutes later it is not working? What I have to do to repeat the execution of the AT command?
modified on Wednesday, June 3, 2009 5:42 AM
|
|
|
|
|
when an Internet Explorer is opened and navigated through other links continuously for sometime, back button(i.e., a navigation toolbar to going to previous url) sould be disabled. How can I do this using c#?
|
|
|
|
|
you can use this javascript function:
window.history.forward(1);
but the Back function can always be achieved by right clicking on the page and choosing to go back.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
|
This is one of the question which appears almost every 2-3 days.
Look at this [^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i have a class and i assing this class value then
when i sorted this value or class value, both sorted
example code folowing :
int[] ggg=new int[5];
int[] ggg1=new int[5];
ggg = networks.layers[i].noron[j].sbaglanti;
ggg1 = ggg;
Array.Sort(ggg);
how can i solve this problem ?
regards
|
|
|
|
|
That is because System.Array is a reference type. When you assign ggg1 = ggg , both ggg and ggg1 refer to the same array instance, so calling Array.Sort on either reference will change that instance.
Check out MSDN[^] or search for value types and reference types in Google.
|
|
|
|
|
i understand but if arrays is referans value, how can i solve my problem?
|
|
|
|
|
You typically find a way to clone the source reference. In this case, Array.Copy should do the trick. Bear in mind that if the elements in the array themselves are reference types, then Array.Copy won't clone them.
|
|
|
|
|
That's what i said 10 minutes ago 
|
|
|
|
|
have you tryed :
Array.Copy(ggg, ggg1, 5);
|
|
|
|
|
int[] ggg = new int[5];
ggg = networks.layers[i].noron[j].sbaglanti;
int[] ggg1 = (int[]) ggg.Clone();
Array.Sort(ggg);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thanks friends.
i solved with array.copy();
regards
|
|
|
|
|
|
How to implement IUrlHistoryStg Interface in c#?
|
|
|
|
|
Hi,
I publish my windows application using clickonce. When some clients try to download it error occur. It is downloading in many other client machines with out any problem.
The deploy files are not getting downloaded in some client machine. I also delete the Apps folder in those machine and try again, same error occur.
Is ther any problem with the client machine or any problem in publishing?
Details of error :-
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.42
System.Deployment.dll : 2.0.50727.42 (RTM.050727-4200)
SOURCES
Deployment url : http://192.168.1.41/ -- My URL ---
Server : Microsoft-IIS/5.1
X-Powered-By : ASP.NET
Deployment Provider url : http://192.168.1.41/-- My URL ---
Server : Microsoft-IIS/5.1
X-Powered-By : ASP.NET
Application url : http://192.168.1.41/-- My URL --- .exe.manifest
Server : Microsoft-IIS/5.1
X-Powered-By : ASP.NET
IDENTITIES
Deployment Identity : board.application, Version=1.0.0.5, Culture=neutral, PublicKeyToken=735d61f06c2141e7, processorArchitecture=msil
Application Identity : board.exe, Version=1.0.0.5, Culture=neutral, PublicKeyToken=735d61f06c2141e7, processorArchitecture=msil, type=win32
APPLICATION SUMMARY
* Installable application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://192.168.1.41/-- My URL --- resulted in exception. Following failure messages were detected:
+ Exception occurred loading manifest from file Client.dll: the manifest may not be valid or the file could not be opened.
+ File Client.dll is not a valid Portable Executable (PE) file.
+ The process cannot access the file 'C:\Documents and Settings\administrator\Local Settings\Temp\Deployment\L774NNJ6.6QD\EPT7095T.X26\Client.dll' because it is being used by another process.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [3/13/2009 10:41:24 AM] : Activation of http://192.168.1.41/--- My Link -- has started.
* [3/13/2009 10:41:25 AM] : Processing of deployment manifest has successfully completed.
* [3/13/2009 10:41:25 AM] : Installation of the application has started.
* [3/13/2009 10:41:25 AM] : Processing of application manifest has successfully completed.
* [3/13/2009 10:41:27 AM] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [3/13/2009 10:41:27 AM] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
- Exception occurred loading manifest from file Client.dll: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ManifestLoadExceptionHelper(Exception exception, String filePath)
at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
at System.Deployment.Application.Manifest.AssemblyManifest..ctor(String filePath)
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.IO.IOException
- File Client.dll is not a valid Portable Executable (PE) file.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.PEStream.ConstructFromFile(String filePath, Boolean partialConstruct)
at System.Deployment.Application.PEStream..ctor(String filePath, Boolean partialConstruct)
at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
--- Inner Exception ---
System.IO.IOException
- The process cannot access the file 'C:\Documents and Settings\administrator\Local Settings\Temp\Deployment\L774NNJ6.6QD\EPT7095T.X26\Client.dll' because it is being used by another process.
- Source: mscorlib
- Stack trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Deployment.Application.PEStream.ConstructFromFile(String filePath, Boolean partialConstruct)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Thank you
YPKI
|
|
|
|
|
Hi Everyone,
I have Database XML which has list of all tables in the database and separate xml's for each table.
Instead of reading each table from database in C# and exporting the data to Excel.... my rqmt is to read this database XML and fetch the data from it and dump into excel file .
If, I have 10 tables and I want to dump the table data into separate worksheet in excel.
please suggest me the better way of working this.
Thanks in advance.
Ram
|
|
|
|
|
Hey
Ok so I am making a program with mutliple textboxes and what I want to do is when the textbox_enter event occurs it changes some properties of that textbox but i dont wanna make 20 textbox_enter events for each textbox. What is the code to mainstream it so for every textbox goes through the same event handler? And also in the event how do i select the textbox which started the event. E.g I know this. is used to select the current form. Is there a equivalent keyword for the element of the form being used?
Thanks in advance! 
|
|
|
|
|
textbox1.Event += new RequiredEventArgs(MethodName);
textbox2.Event += new RequiredEventArgs(MethodName);
etc...
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Well you can do this either using Property box or even creating the event handler yourself.
this.textBox3.Enter += new System.EventHandler(this.GenericTextBox_Enter);
this.textBox2.Enter += new System.EventHandler(this.GenericTextBox_Enter);
this.textBox1.Enter += new System.EventHandler(this.GenericTextBox_Enter);
private void GenericTextBox_Enter(object sender, EventArgs e)
{
MessageBox.Show(((TextBox)sender).Name);
}
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You can save characters by simply writing
this.textBox3.Enter += GenericTextBox_Enter;
this.textBox2.Enter += GenericTextBox_Enter;
this.textBox1.Enter += GenericTextBox_Enter;
Easier to read, too.
|
|
|
|
|
caveat. Only from .NET 3.5 IIRC.
|
|
|
|
|