|
|
hey
i need a little help with this little issue.
i have this file which contains paths to some other files.
but i need to edit those paths before trying to use them because the extension is incorrect.
for example: suppouse i have a file called "listOfFiles.txt"; one of its many lines says "c:\blaf.txt" and this file exists but it's not the one i need to open; i need "c:\blaf.jpg" which exists too.
how can i retrieve this information? i'm using an "open file dialog" and "streams". and, once i get the info, how can i edit it to open the right file?
can anyone give me an example?
thanks
|
|
|
|
|
use Path.ChangeExtension()
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
check this example...
Textreader tr = new StreamReader("listOfFiles.txt");
Path.ChangeExtension(tr.ReadLine(), ".jpg")
whatever the file extension maybe, it will be changed to a .jpg
Have a Happy Coding.....
|
|
|
|
|
If you require to only change the extension , the suggestion provided by other techies are just perfect...
But if you want to see the files list...
Edit it,
change it in any way then you might need to do this...
string data = File.ReadAllText("D:\ListOfFiles.txt",Encoding.Default);
This will give you all the lines of code...
And if you need to take the data line by line then you may do it in this way .
string[] data = File.ReallAllLines("D:\ListOfFiles.txt",Encoding.Default);
This will give you the array of strings of lines of listoffiles...
And then you all need to do is some cutting and attaching using string functions.....
|
|
|
|
|
I have a windows desktop application and created an installer for it using a deployment project. The installer works and I installed on two machines. However, the exact same installer's application behaves differently on both machines. I have a form with radio buttons and combo boxes. The last radio button should be selected by default when form is opened and none of the combo boxes should have any item selected. On the first machine it behaves as it should. On the second machine the first radio button is selected and the first item in all of the combo boxes are selected as well--pretty weird.
What could be causing this?
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Its possible that the code you use used may not completely work by that .Net Framework or its a OS problem.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi!
Is it possible to force an application (WPF) to be shown on a specific monitor?
I need this because my three applications are windowstate maximized without border, each one should be shown on another monitor.
thx in advance,
eza
|
|
|
|
|
If you get an answer can you reply on this thread too, I would be interested in this as it is an issue with my company's app. We have a crude solution, but something elegant would be cuwel.
Thanks
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I don't know about in WPF, but in WinForms you can get an array of all the available screens using the static
Screen.AllScreens readonly property. So long as the form's StartPosition is FormStartPosition.Manual then you can use the desired screen's bounds to make sure it goes to the right place.
If nothing similar exists in WPF, I believe you can still add a reference to System.Windows.Forms which should allow you to do this.
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)
|
|
|
|
|
Hi,
I have done such things many years ago, and can't test it right now. This is how I remember it:
- AFAIK there is no single command to do it;
- assuming the desktop extends across all monitors, the virtual desktop has boundaries much larger than the normal 1280*1024 or whatever resolution you use;
- open your window in normal mode (not maxed/mined) and keep its size below one screen full;
- now move it around by setting its topleft corner, move it to a point that is near the topleft of the monitor you want;
- only then maximize it.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Found only System.Windows.Forms.AllScreens which can be used but is not how I really like it to be done. The reason is I'm using WPF, and just for this using the Windows.Forms is a pain.
Has anyone an idea of how much extra RAM I need for using Windows.Forms just for one function?
As far as I've ssen there aren't really any alternatives (except using unmanaged code and p/invoke) but this is the least think I really want to do (beyond using e.g NVIDIA APIs).
More ideas are welcome!
greets,
eza
|
|
|
|
|
Hi
I have some Web Service Question
I work whit VS2005 , and I need to build WS
1. Is WS can copy/move/delete files or folders ?
2. Is Ws can make SDF Database file ?
thank's in advance
|
|
|
|
|
E_Gold wrote: 1. Is WS can copy/move/delete files or folders ?
On the server the Web Service runs on, yes (security considerations notwithstanding). On the client it would depend on what the consumer of the Web Service is built to do, which you won't necessarily be in control of.
E_Gold wrote: 2. Is Ws can make SDF Database file ?
On the server, yes. And this could be serialized and sent to consumers of the Web Service.
print "http://www.codeproject.com".toURL().text
Ain't that Groovy?
|
|
|
|
|
It seems that you need to read a bit more about web services. They are nothing but a Web application programming interfaces software system that supports interaction over a network.
In your web service, you can do whatever you want to do.
E_Gold wrote: 1. Is WS can copy/move/delete files or folders ?
Yes, you can work with files and folders
E_Gold wrote: 2. Is Ws can make SDF Database file ?
yes you can work with any database.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Has anyone successfully integrated ImageMagick with vs.net 2008? I am currently using c#, but as long as I can compile the code in 2008 I should have a working DLL to reference. Any pointers on where to get the source code and what to do to get it compiled would be wonderful.
Thanks in advance
|
|
|
|
|
Are you trying to compile IM in VS2008? No I have not tried that, but it works like charm in VS2005.
you can get all you need to know about Image Magic at imagemagick.org[^]
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yes, I am trying to compile IM in vs 2008. Had it working for over a year in vb.net 2005, now updating code to c#2008 and so far it's a bear!
imagemagick.org has nothing of use on using it in vs 2008.
Thanks for the reply
|
|
|
|
|
Hi Folks,
I made a test app with sql server 2008 and vc# 2008.
Used dataset, bindingsource, table adapter, bindingnaviagator
When i am displaying data on the form in textbox, combobox, text area
i found that the data is added with extra whitespace upto the width of the
column in table. if my db column size is char(30), and it actually has a value
of 10 chars...when i retrieve record it displays 10chars +20whitespace on text
box and the text goes hidden to left side in textbox etc....
Is there a way to fix this????????? Coz i am using bindingsource and tableadapter
i cant handle it at db level trimming....pls help.....These whitespaces are
really irritating.......
regards
shafi
|
|
|
|
|
You could trim your string before entering into the database,
example:
string str = "my blank spaces ";
str = str.Trim();
This will trim all whitespace from front or back of the string.
Hope that helps.
|
|
|
|
|
Hi there,
Trim() i used ......
Its the first time...........like a form with a binding navigator directly picking db values. we use trim when we are sending the records to db........
Using binding navigator it calls a Fill() function on tableadapter..and retrieves records from dataset
Is there a way to edit default fill query in C#....I think if i can edit the default query i can add DB Trim function and my problem will be solved........Can anybody know how to edit Fill query of a binding navigator or dataset
pls help
|
|
|
|
|
I run the query in access and it populates results fine. It is a simple select command. I think I might just have the code wrong somewhere just can't figure it out. Please help. The headers populate in the datagridview but none of the data does.
private void QueryTest()
{
pcDataConn = Utility.DBConnection();
try
{
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = pcDataConn;
cmd.CommandText = "FHD_qry";
DataSet ds = new DataSet();
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
adapter.Fill(ds);
DataTable dt = ds.Tables[0];
pcDataview.DataSource = dt;
int totalResults = dt.Rows.Count;
Resultslabel.Text = "Results: " + dt.Rows.Count.ToString();
if (totalResults > 0)
{
Exportbutton.Enabled = true;
}
else
{
Exportbutton.Enabled = false;
}
}
catch(Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
pcDataConn.Close();
}
|
|
|
|
|
I figured it out. It was the whole wildcard through the OleDb connection. I just changed the ?'s to #'s in the stored procedure and it worked fine.
|
|
|
|
|
Hello all,
I'm building this app. that stores list of files in a directory in a database (called an image in the app's terminology) and then lets you browse the directory even if it has been deleted. Now my problem is that, I want to provide search facility, so that a user can search the files. The user would be able to search within as many images as he likes simultaneously.
Now I can't figure out, how to implement the UI for the search results. The search input will be taken through a separate dialog box. But I really can't decide about the UI mechanism. I mean, I want everything to be very clear & concise. Further, I want the search results to be visible in the same window. Please don't suggest using tabs . Please help
Here[^] is a pic of the current UI.
Thanks in advance.
Excuse me for buttin' in, but I'm interrupt driven.
|
|
|
|
|
keep data in any source like DataTable, XML...then when user search read the data from source and add only those you want. And in DataTable you can use Select() to filter the result.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|