Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

abbd

@abbd
About
Posts
294
Topics
132
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • convert large files into byte []
    A abbd

    Hello, how can i convert the large files that exceed 2GB in the binary table, I use byte [] data = File.ReadAllBytes (path); and i have exception. There are another way? thank you very much.

    C# question

  • Attempted to read or write protected memory
    A abbd

    i don't find an answer, when i open new project, i have the same error, thank you verry mutch for your help.

    ASP.NET help csharp visual-studio performance

  • Attempted to read or write protected memory
    A abbd

    Hello,

    I can't launch my site on my machine since Visual Studio 2008 SP1, I get the following error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt

    Thank you for your help.

    ASP.NET help csharp visual-studio performance

  • Several HTTPS sites on the same server! possible?
    A abbd

    Hello,

    I am able to install multiple sites in http on the same server (using the http header).
    unfortunatly i can't install it in https, I installed the certificate on port 443 for the first site then what must be done to the second site? Port 443 is used by the first site, Thanks for your help.

    NB: I use IIS v6.0

    ASP.NET sysadmin windows-admin cryptography help question

  • Multiple lines : datagridview
    A abbd

    Hi, i work with asp.net c#, how can we insert multiple lines text (label) in a single row of datagridview? Thank you verry mutch.

    C# csharp asp-net question

  • Response of the FTP server
    A abbd

    Hello, I use this code to send files to the FTP server :

    FtpWebRequest myRequest = (FtpWebRequest)FtpWebRequest.Create(ftp://ftp.server.com/test.txt);
    myRequest.Credentials = new NetworkCredential(TEST,HEROS);
    myRequest.Method = WebRequestMethods.Ftp.UploadFile;

    FileStream stream = File.OpenRead(@"c:\test.txt");
    byte[] buffer = new byte[stream.Length];
    stream.Read(buffer, 0, buffer.Length);
    stream.Close();

    Stream reqStream = myRequest.GetRequestStream();
    reqStream.Write(buffer, 0, buffer.Length);
    reqStream.Close();

    How i can receive the reponse, the server ftp return an ID of commande, i can see this number in FilZilla, bu i need to retrieve this id on C#, thank you verry mutch.

    C# csharp com sysadmin

  • Upload file usin MTOM
    A abbd

    Hello, I want to make a web service that receive files using MTOM:

    [WebMethod]
    public void Upload(string FileName, byte[] buffer, long Offset)
    {
    string FilePath = Path.Combine(UploadPath, FileName);

        using (FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.Read))
        {
            fs.Seek(Offset, SeekOrigin.Begin);
            fs.Write(buffer, 0, buffer.Length);
        }
    
    }
    

    i have this error : System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path 'C:\MTOM\AA' is denied. 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 MTOM.Service1.Upload(String FileName, Byte[] buffer, Int64 Offset) in C:\Documents and Settings\Administrateur\Bureau\MTOM\MTOM\MTOM.asmx.cs:line 41

    C# sysadmin security help

  • Hash Whirlpool
    A abbd

    Is there a Whirlpool class in C# ?

    C# csharp cryptography question

  • concatenate the word document, it's possible?
    A abbd

    Thank you verry mutch for your answer, so i need to merge the word file in the memory, because i don't want to generate all 1000 files. please help me.

    C# com question

  • concatenate the word document, it's possible?
    A abbd

    How we can concatenate the word document, I explain, i would make a single document of 1000 pages (each document is on one page) and then save only a single document instead of 1000, thank you much. i use this to crate one document :

                String\[\] tbStr2 = s.Split(new Char\[\] { ';' });
                string nb = tbStr2\[0\];
                Object oMissing = System.Reflection.Missing.Value;
                Object oTrue = true;
                Object oFalse = false;
                Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
                Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
                oWord.Visible = true;
                oWord.Visible = false;
                Object oTemplatePath = modelee;
                oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
                bool sympb = false; bool E = false; bool n = false; bool p = false; bool r = false;
    
                foreach (Microsoft.Office.Interop.Word.Range range in oWordDoc.Words)
                {if (range.Text.Trim().Contains("$"))
                    {   int pos = range.Text.Trim().IndexOf("$");
                        string str = range.Text.Trim().Replace("$", "");
                        range.Text = str;} }
                        
                foreach (Microsoft.Office.Interop.Word.Range range in oWordDoc.Words)
                {if (range.Text.Trim().Contains("$$"))
                    {   int pos = range.Text.Trim().IndexOf("$$");
                        string str = range.Text.Trim().Replace("$$", "");
                        range.Text = str;} }
                
                Object oSaveAsFile ="./1.doc";
                oWordDoc.SaveAs(ref oSaveAsFile, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing);
                oWordDoc.Close(ref oFalse, ref  oMissing, ref oMissing);
                oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
    
    C# com question

  • Close wrod corrctly, it's possile?
    A abbd

    Hello, How in can run it invisible for the time being? please help me to resolve this great big problem.

    C# com sysadmin question

  • Close wrod corrctly, it's possile?
    A abbd

    Unfortunately i have the same problem, please help me.

    C# com sysadmin question

  • Close wrod corrctly, it's possile?
    A abbd

    Hello, I create 4000 files word like this :

    foreach (string s in FUSIONSS_1)
    {

                String\[\] tbStr2 = s.Split(new Char\[\] { ';' });
                string nb = tbStr2\[0\];
                Object oMissing = System.Reflection.Missing.Value;
                Object oTrue = true;
                Object oFalse = false;
                Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
                Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
                oWord.Visible = true;
                oWord.Visible = false;
                Object oTemplatePath = modelee;
                oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
                bool sympb = false; bool E = false; bool n = false; bool p = false; bool r = false;
               
                foreach (Microsoft.Office.Interop.Word.Range range in oWordDoc.Words)
                {if (range.Text.Trim().Contains("P"))
                    {   int pos = range.Text.Trim().IndexOf("P");
                        string str = range.Text.Trim().Replace("P", "O");
                        range.Text = str;} }
                Directory.CreateDirectory((Object)path + "./PUBLI/" + nb);
                Object oSaveAsFile = (Object)path + "./PUBLI/" + nb + "/" + nb + ".doc";
                oWordDoc.SaveAs(ref oSaveAsFile, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                ref oMissing, ref oMissing);
                oWordDoc.Close(ref oFalse, ref  oMissing, ref oMissing);
                oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
            }
    

    unfortunately the process winword.exe don't be kill on the task manager of my server. How i can close the word file correctly?, thank you verry mutch.

    C# com sysadmin question

  • Control integrity of ZIP files
    A abbd

    Hello, I want to do the integrity check zip files, I would use 7zip library with the command 't' using this code:

    try
    {
    Process rr = Process.Start(@"..\Release\7Z\7z.exe ", @" t ..\Release\.zip > .\1.test");
    rr.WaitForExit();
    }
    catch (Exception ex)
    {
    Console.WriteLine(ex.ToString());
    }

    Order fontionne well on the lin command (CMD), except with the code below, it doesn't generate the file 1.test. Thank you verry mutch.

    C# announcement

  • ThreadPool don't work
    A abbd

    I need to pass parameters (like arraylist,...) to the TEST method, how i can do this ? I don't understand whay the test methode must have juste the object parameters.

    modified on Tuesday, May 17, 2011 5:45 AM

    C# com

  • ThreadPool don't work
    A abbd

    i find the solution, we must add doneEvents[int.Parse(threadContext.ToString())].Set(); after the and of generation.

    modified on Tuesday, May 17, 2011 5:05 AM

    C# com

  • ThreadPool don't work
    A abbd

    Hello, I try for :

    Object oMissing = System.Reflection.Missing.Value;
    Object oTrue = true;
    Object oFalse = false;
    Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
    Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
    oWord.Visible = true;
    oWord.Visible = false;
    Object oTemplatePath = @".\1.doc";
    oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);

            foreach (Microsoft.Office.Interop.Word.Range range in oWordDoc.Words)
            {
                if (range.Text.Trim().Contains("P"))
                {
                    int pos = range.Text.Trim().IndexOf("P");
                    string str = range.Text.Trim().Replace("P", "");
                    range.Text = str;
                }
    
            }
            Directory.CreateDirectory(@"F:\\PS-IN\\"+threadContext);
            Object oSaveAsFile = @"F:\\PS-IN\\" + threadContext+"\\\\" + threadContext + ".doc";
            oWordDoc.SaveAs(ref oSaveAsFile, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
            ref oMissing, ref oMissing);
            Console.WriteLine(threadContext+" "+DateTime.Now.ToShortTimeString());
            oWordDoc.Close(ref oFalse, ref  oMissing, ref oMissing);
            oWord.Quit(ref oMissing, ref oMissing, ref oMissing);
        }
    
        static void Main(string\[\] args)
        {
    
            const int FibonacciCalculations = 50;
    
            // One event is used for each Fibonacci object.
            ManualResetEvent\[\] doneEvents = new ManualResetEvent\[FibonacciCalculations\];
            Program\[\] fibArray = new Program\[FibonacciCalculations\];
            Random r = new Random();
    
            // Configure and start threads using ThreadPool.
            Console.WriteLine("launching {0} tasks...", FibonacciCalculations);
            for (int i = 0; i < FibonacciCalculations; i++)
            {
                doneEvents\[i\] = new ManualResetEvent(false);
                Program f = new Program();
                fibArray\[i\] = f;
                ThreadPool.QueueUserWorkItem(f.TEST,i);
            }
    
            // Wait for all threads in pool to calculate.
    
    C# com

  • ThreadPool don't work
    A abbd

    i would usoont the threading pool because there ara many advantages, like the memory using, i dont have visual studio 2010, i work with 2008, thank you for answhering me.

    C# com

  • ThreadPool don't work
    A abbd

    i would excute the TEST method 5X in the same time, how in can do this?

    C# com

  • ThreadPool don't work
    A abbd

    exactly, whene i put Thread.Sleep(10000); the TEST method was excuted, so i need to wait the time necessary for executin my method, it's possible?

    C# com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups