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
N

NJdotnetdev

@NJdotnetdev
About
Posts
49
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Long Path Exception when adding attachments
    N NJdotnetdev

    Yes. I was able to fix this issue. The above code was correct, the only exception of "File was closed" was giving me trouble. Fixed it by keeping the file stream opened while sending(SMPTPClient.send()) the email. Thanks for the help.

    C#

  • Long Path Exception when adding attachments
    N NJdotnetdev

    Can someone please advise? Really appreciate your time and help.

    C#

  • Long Path Exception when adding attachments
    N NJdotnetdev

    I am getting a long path exception while adding attachments to MailMessage. Our file path exceeds 260, but that's how it is and we want it to work. Following is what I have done to avoid the exception:

    private void CreateAttachments(MailMessage mailMessage, List filesToAdd)
    {
    foreach (string fileToAdd in filesToAdd)
    {
    SafeFileHandle fileHandle = null;
    try
    {
    fileHandle = Common.CreateFile(Common.prefixPath(fileToAdd), Common.GENERIC_READ, FileShare.Read, IntPtr.Zero, FileMode.Open, 0, IntPtr.Zero);
    if (!fileHandle.IsInvalid)
    {
    using (FileStream fs = new FileStream(fileHandle, FileAccess.Read))
    {
    Attachment data = new Attachment(fs, fileToAdd);
    mailMessage.Attachments.Add(data);
    }
    }
    }
    finally
    {
    if ((fileHandle != null) || fileHandle.IsInvalid)
    fileHandle.Dispose();
    }
    }
    }

    Above LOC doesn't throw an exception while adding attachments. But, while sending(smtpClient.Send(mailMessage)) it throws an exception "Failure Sending Mail". UPDATED CODE

    C#

  • Compress pdf/csv files to zip files
    N NJdotnetdev

    I am using System.IO.Compression to create zip file of PDF or CSV files. I used CompressionLevel.Optimal to maximize the compression ratio. However, the percent of compression is 10-12%. Was wondering if there is another efficient way to do it? Framework: 4.5

    C# question

  • How to get scrollbars in TGridPanel?
    N NJdotnetdev

    I am trying to get two columns in TGridPanel, where user will be able to drag , drop and move around GUI components(TImage) at runtime. I can drag and drop, however TGridPanel doesn't show scrollbars when I drop a lot of elements. It starts to shrink the ones already init. To have scrollbars I added this grid panel on TScrollBar and changed "Align" property to "alClient". My plan is to save the final setting of components in a 2D array. My plan is to have at least one component per row to save the row of TGridPanel.

    Delphi css data-structures tutorial question

  • Group by - Custom function
    N NJdotnetdev

    I have following row data in a json file: {rows:[ {id:1,data:["1","A","10"]} ,{id:2,data:["2","B","50"]} ,{id:3,data:["3","C","60"]} ,{id:4,data:["4","D","70"]} ,{id:5,data:["5","E","90"]} ,{id:6,data:["6","F","2"]} ,{id:7,data:["7","G","4"]} ,{id:8,data:["8","H","50"]} ,{id:9,data:["9","B","100"]} ,{id:10,data:["10","A","60"]} ,{id:11,data:["11","K","0"]} ,{id:12,data:["12","L","20"]} ]} I was wondering if I can get a kick start suggestion to write our own group by function to group on any column. Like in above example, we can use the second column to group by. The only restriction I have is that I can't use jquery and have to use java script only. Need expert help...

    JavaScript java javascript tools json help

  • Write log from multiple instances of an application.
    N NJdotnetdev

    Quick question: Will there be a problem if multiple instances of the same application try to write in the same flat file at the same time? I found following text on MSDN: You should not configure more than one Flat File sink or Rolling Flat File sink instance to write to the same physical file. However, you can enable the same listener (and sink) on multiple event sources and funnel the events from those multiple event sources to the same file. Link: Logging events to a disk file[^]

    C# help csharp algorithms question learning

  • Write log from multiple instances of an application.
    N NJdotnetdev

    Thanks a lot Richard for the advise. Will look in to it. :) :)

    C# help csharp algorithms question learning

  • Write log from multiple instances of an application.
    N NJdotnetdev

    My C# dll is loaded by an application. I wanted to add logging in the dll. The only question in mind is how I can make sure that only one instance of the loaded dll is writing to the log file at a given time. I found following approaches while searching, but not 100% sure if they would help: 1. Use FileShare Enumeration: But, this might cause problem if the first process hangs and blocks the resource. 2. Use Mutex: It was recommended to not use as it doesn't help when there are multiple processes accessing the same file. It is helpful when multiple threads are accessing the same file. Since, I can be wrong in my assumption so wanted to ask experts for some advise. Thanks.

    C# help csharp algorithms question learning

  • Load XML string in to TTreeView
    N NJdotnetdev

    Thanks a lot for the help.

    Delphi xml help

  • Conditional RunTime code
    N NJdotnetdev

    It's managed and loaded once at a given time.

    C# help

  • Conditional RunTime code
    N NJdotnetdev

    Please correct me if it's a bad approach: I was thinking to set a boolean flag variable/property in overloaded function. This variable/property can be defined in a common static class. Finally, use this flag to execute LOC selectively.

    C# help

  • Conditional RunTime code
    N NJdotnetdev

    I am implementing this for the first time, so need expert advise. Following is what I am trying to achieve: -- I have a dll which is called by the exe application from two different places. My aim is to not call certain loc in dll when it is called from the first location. I don't think conditional directives will help as they would not compile the code. I want to skip loc at runtime based on the call from the application. Dll will have an overloaded function implemented to distinguish between the calls.

    C# help

  • Get X Axis label and interval
    N NJdotnetdev

    400 value is in example. I came up with those numbers to explain what I am trying to achieve. Actually, I did figure this out. Thanks.

    Algorithms algorithms tutorial

  • Get X Axis label and interval
    N NJdotnetdev

    Hi All, I am trying to come up with an algorithm to get following three piece of information to plot a chart: 1. Start : Should be close to the minimum value of the dataset 2. Stop : Should be close to the maximum value of the dataset 3. Interval : Should be such that it will have "0" on the axis when interval traverses from minimum to maximum. Example: dataset{-266,-17.6,0.5,2000,6000} My final return values should be: Start: 400 Stop: 6000 Interval:200 Note: Since start is 400 and interval is 200, we will have 0 as a point on the x-axis.

    Algorithms algorithms tutorial

  • Get Axis interval
    N NJdotnetdev

    Sure... Will do that...

    JavaScript algorithms tutorial

  • Get Axis interval
    N NJdotnetdev

    I am going to implement this is javascript. We have data in csv format which will be read by the JS function and the start, stop and interval will be sent to third party library to create chart. The algorithm I am looking for can be pseudo code. It's not specific to JS, but would be a big help to know if some one would have implemented this using JS.

    JavaScript algorithms tutorial

  • Get Axis interval
    N NJdotnetdev

    Hi All, I am trying to come up with an algorithm to get following three piece of information to plot a chart: 1. Start : Should be close to the minimum value of the dataset 2. Stop : Should be close to the maximum value of the dataset 3. Interval : Should be such that it will have "0" on the axis when interval traverses from minimum to maximum. Example: dataset{-266,-17.6,0.5,2000,6000} My final return values should be: Start: 400 Stop: 6000 Interval:200 Note: Since start is 400 and interval is 200, we will have 0 as a point on the x-axis.

    JavaScript algorithms tutorial

  • Browser Resize
    N NJdotnetdev

    Thanks for the reply. I also didn't like the idea. :)

    Web Development

  • Browser Resize
    N NJdotnetdev

    I want to restrict user at certain height and width. Tried implementing window.ResizeTo, but it doesn't work on chrome and when multiple tabs are open. My goal is NOT allow user to shrink browser window beyond certain height and width. Please Advise.

    Web Development
  • Login

  • Don't have an account? Register

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