473,699 Members | 2,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to copy the file in richtextbox .

1 New Member
I am having multiple format files(.jpeg,.tx t,.doc,.excel) in a folder.I want to show those file with their icon in richtextbox in c#.
Expand|Select|Wrap|Line Numbers
  1. i am having file at clipboard.
  2.  string[] files = Directory.GetFiles(pp);
  3.                         DataObject objData = new DataObject();
  4.                         foreach (string file in files)
  5.                         {
  6.  
  7.                             objData.SetData(DataFormats.FileDrop, true, file);
  8.                             Clipboard.SetDataObject(objData, true);
  9.                             lst.Items.Add(file);
  10.                             rht_attachment.Focus();
  11.                             rht_attachment.Paste();
  12.                             rht_attachment.Update();
  13.                         }
  14.                         rht_attachment.Refresh();
Sep 17 '13 #1
1 1679
Aurangzeb
11 New Member
Did you try the SaveFile method located on the RichTextBox itself? http://msdn.microsoft.com/en-us/libr...le(VS.71).aspx
Sep 18 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1526
by: Grey | last post by:
I have a ASP.NET web application which is required to copy file from windows server to Novell Netware server. I have used impersonation to connect to Netware server. The application works fine when the web server installed Novell Client for Windows, but it has error when changed to another web server which is installed Client Services for Netware (windows built-in Novell connector). The error is "System.IO.IOException: The network path...
9
15533
by: MAF | last post by:
Does anyone know why in 2005 I might be getting this error everytime I try and recompile? Error 226 Unable to copy file "obj\Debug\myfile.dll" to "bin\Debug\myfile.dll". The process cannot access the file 'bin\Debug\myfile.dll' because it is being used by another process. myfile
3
2376
by: MAF | last post by:
Does anyone know why in 2005 I might be getting this error everytime I try and recompile? Error 226 Unable to copy file "obj\Debug\myfile.dll" to "bin\Debug\myfile.dll". The process cannot access the file 'bin\Debug\myfile.dll' because it is being used by another process. myfile
5
4221
by: Standist | last post by:
I want install software on PC in my local network. First I want copy file to the PC through default share like c$ or d$ on the PC. Then install the software through wmi. I have the administrator and password of every PC. How can I do this.
1
1655
by: vandanaj | last post by:
hi everyone i want to know how to copy file in asp thanx in advance
0
1391
by: Pivalig | last post by:
Hello, i try to copy file from Pocket PC to network printer using this code : destination = "\\\\pc1\\ep1000\\Bill.txt"; File.Copy("\\Program Files\\MobileKhelner\\Bill.txt", destination); It works well, but borrows a lot of time (48 sec) at the first attempt Next attempt after 5 sec working momentaly. I think, that business in WindowsMobile 5 Help m please!
9
4992
rizwan6feb
by: rizwan6feb | last post by:
Hello everybody. I need help on how to use copy function to copy file from one computer to another ( or any other way i can copy the file). The computers are on a local network.
1
1612
by: Irrigho5 | last post by:
i have the open file function just need help with the copy file function and main Ask for a source filename and a target filename. Then copy the source file to the target file using the open_file() function of problems 3 and 4, a new copy_file(source_file, target_file) function, and a main() function, with the same exception handling as problems 3 and 4. copyfile1.py – The copy_file() function must not use a loop. please im me on AIM...
2
4726
by: foss | last post by:
hi all, I am not able to copy file from a directory in the server to another directory. Here, the source is outside the web root directory and the destination is inside the web root directory. I got a warning The code is as follows:
1
4715
by: rajibdotnet | last post by:
Till Date, I find no solution to the problem below. Unable to copy file "obj\Debug\Tax2010.dll" to "bin\Tax2010.dll". The process cannot access the file 'bin\Tax2010.dll' because it is being used by another process. In my case, I have two projects under one Solution named "Tax2010" 1) Calc and Calc.DLL (contains .cs class files) 2) Tax2010 and Tax2010.DLL (contain .aspx pages along with respective .cs files and other .cs class...
0
8704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9187
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8936
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8894
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7777
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.