|
Have checked is that setting.xml is there in that path ?
can i get your hotmail id if possible we can chat ?
Thanks
Raja.S
|
|
|
|
|
hey man your getting the path with the assembly name discard assembly name from the path and put the setting.xml every thing should work fine
it should be
'C:\\Work\\Developments\\SQLchecks\\SQLchecks\\SQLchecks\\bin\\Debug\\Settings.xml'."
Thanks
Raja.S
|
|
|
|
|
Hi,
These files are present in:
C:\Work\Developments\SQLchecks\SQLchecks\DataAccess\bin\Debug
DataAccess.dll
Settings.xml
...
...
|
|
|
|
|
Find the code here
// get current path for the assembly
string path = Assembly.GetExecutingAssembly().Location;
path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path),".."));
path = path + @"\setting.xml";
Thanks
Raja.S
|
|
|
|
|
final code here
using System.IO;
using System.Reflection;
// get current path for the assembly
string path = Assembly.GetExecutingAssembly().Location;
path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path),".."));
path = path + @"\setting.xml";
pls let me know the result
Thanks
Raja.S
|
|
|
|
|
Hi,
Error is:
Message: "Value cannot be null.\r\nParameter name: inputUri"
|
|
|
|
|
this excemption seems to be some problem in your application code , code which i have provided you, i have tested, it is getting the running assembly path and then with .. its discaring the assembly name and get the setting.xml file.
Thanks
Raja.S
|
|
|
|
|
Hi,
Using your code the path is:
"C:\\Work\\Developments\\SQLchecks\\SQLchecks\\SQLchecks\\bin\\Settings.xml"
But after publishing, the Settings.xml is sitting inside the debug so somehow I need to access:
"C:\\Work\\Developments\\SQLchecks\\SQLchecks\\SQLchecks\\bin\\Debug\\Settings.xml"
So I used the following code:
path = AppDomain.CurrentDomain.BaseDirectory + "Settings.xml";
This seems to be working fine on my Development machine but after publishing it to users machines then this does not seem to get the Settings.xml file.
Not sure what I am doing wrong?
Thanks
|
|
|
|
|
Here's a chunk of code that might help you with this. If you set "test.xml" as an "embedded resource", rather than "content", then it will actually reside inside the compiled library file, and you can access it like this:
using ( Stream prototype = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "Namespace.test.xml" ) ) {
byte[] fileData = new byte[ prototype.Length ];
prototype.Read( fileData, 0, (int)prototype.Length );
File.WriteAllBytes( filePath, fileData );
}
Be sure to use the namespace when identifying the file name. I think there are other overloads of this function you can use as well.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Yes, I changed it fro mcontent to Embedded resource.
How about using the following code instead of yours
path = AppDomain.CurrentDomain.BaseDirectory + "Settings.xml";
This works on my machine but not when it is published to the users machines using clickonce.
The error on users machine is:
Can not find file 'c:\Documents and Settings\JoeDowe\localsetting\App\2.0\...\Settings.xml'
Why is the system looking in Documents and Settings?
Thanks
|
|
|
|
|
First you have to build your application with release mode, in the release mode where is the setting.xml is copied or else you can create a build event to copy to the files into specific location then try to publish this applciation .are you publishing the application to FTP or some URL or to the specific disk location ?
Thanks
Raja.S
|
|
|
|
|
This is now solved by manually placing the xml file into the windows application project and then publish.
Thanks
|
|
|
|
|
Copying also you can do it by build events no need to do that manually
Thanks
Raja.S
|
|
|
|
|
How do you mean please?
When I build, the file does not copy from class library prohect to the windows app project, so I have to do it manually.
Thanks
|
|
|
|
|
how can i convert .wav file to g.711 using c#.net to push it in cisco ip phones
Thanks in advance
|
|
|
|
|
This[^] article may help
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
sorry dave but can you tell me the steps to convert from .wav to g.711
i have read your article but i couldn't find where i will give it my .wav file
|
|
|
|
|
It's not my article - it's by Marc Sweetgall[^]
It looks like you should be able to use the public static byte[] MuLawEncode(byte[] data) method to get a g7111 encoded byte array from a wav (PCM) byte array.
I haven't tried it, but simply reading the wav file using a stream into a byte array, encoding and then saving the encoded byte array may be enough. You may need to strip out any headers in the wav file so you just have pure PCM - I'm not sure. It may be worth asking the author of the article, although he doesn't appear to have been active here for around a year.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
thanks dave for your help i will try
thanks again
|
|
|
|
|
Can any1 help...im trying to clear a Request.QueryString["Value"]...i have tried Request.QueryString["Value"].remove(0) and Request.QueryString.clear() and to no success...plz help
living life on the flip side
|
|
|
|
|
Why do you want to clear QueryString? If you don't want user to view it and want to pass thing to other page. use session variable.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
im using the querystring for loading data..querystring value loads a contact treeview...wen i click new all must be loaded again but with no values...so querystring must be cleared?
living life on the flip side
|
|
|
|
|
If it is the same page use ViewState
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
How about this?
int indx = Request.Url.OriginalString.IndexOf("?");
if(indx > -1)
Response.Redirect(Request.Url.OriginalString.Substring(0,indx));
Jim
|
|
|
|
|
Hi all,
I would like to know if the .Net frameworks provides any classes / methods that enables you to read mail from an Exchange Mail server. If so, could you please inform me.
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|