|
Hello all of you,
I made a webservice and I can't get this to run via proxy.
the basic procedure on the client side looks like this:
MyWebservice service = new MyWebservice();
WebProxy iProxy = new WebProxy(_proxyAdress, true);
service.Proxy = iProxy;
...
if(service.LogOn(user, pass))
{
...
data = service.GetMyData();
now what happens is that the session variables are lost on the GetMyData() call
on the server side:
[WebMethod (EnableSession = true)]
public bool Logon(string s, string p)
{
...
Context.Session.Add ("LoggedIn", true);
...
return
}
[WebMethod (EnableSession = true)]
public SomeData GetMyData()
{
...
if(Context.Session ["LoggedIn"])
...
}
Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. 
|
|
|
|
|
Have you tried regenerating the proxy?
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Yes I did, thx for the tip
|
|
|
|
|
I suppose you need to attach CookieContainer to your web service instance using CookieContainer property of SoapHttpClientProtocol class.
service.CookieContainer=new System.Net.CookieContainer();
Read here more about Session and web methods.
Life is a stage and we are all actors!
|
|
|
|
|
I use cookie container, thx for the response...
|
|
|
|
|
Hi all,
Is there a way to open a named browser window from a windows application.
From ASP.NET i used javascript's "window.open(url,name)", is there some way i can achieve the same result from a windows application.
I tried some things with the System.Diagnostics.Process.Start(), but i don't know if it is possible to give the name for the new window in the parameters (if it is possible, i don't know how )..
Any ideas?
Thanks in advance.
|
|
|
|
|
do
{
iniText = iniStream.ReadLine();
if(String.Compare(iniText.Substring(0,1),("*")) == 0)
continue;
string [] dataItems = iniText.Split(new Char [] {','});
dataGridView1.Rows.Add(dataItems);
} while (iniText != null);
When stepping through the code, dataItems correctly contains each array of comma separated variables, but the datagrid control is not being populated with the Rows.Add method. What am I missing?
t.i.a
OK, I changed it to this
do
{
iniText = iniStream.ReadLine();
if (iniText == null)
continue;
if(String.Compare(iniText.Substring(0,1),("*")) == 0)
continue;
string [] dataItems = iniText.Split(new Char [] {','});
dataGridView1.Rows.Add(dataItems);
} while (iniText != null);
obviously I need to rethink my loop logic. But when i step through in Debug with F5 it populates the control properly, when I run without debugging, it is still empty. Why does that happen?
modified on Wednesday, October 14, 2009 2:42 AM
|
|
|
|
|
I agree your loop logic needs some work, but in both original form and the modified form below it works fine either debugged or run as release version.
Without seeing the rest of your code, I can only assume the difference is path related - is the file you are reading relative to the debug code folder and thus not available in the release version?
string[] lines = File.ReadAllLines(@"C:\XXTemp\new.txt");
foreach (string line in lines)
{
if (!line.StartsWith("*"))
{
dataGridView1.Rows.Add(line.Split(','));
}
}
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thanks. Of course, that is exactly what it was, I hadn't changed the file read section to allow the user to browse for an actual file location!
doh! thanks for the heads up
|
|
|
|
|
Hi,
I want to write some data to an excel sheet. If it is open, then write to the same excel sheet, if not open, then open the excel sheet and perform operations.
I dont know how to get control of the open excel sheet.
Here is my code:
//check if the worksheet is already open.
try
{
using (FileStream fs = File.Open(txtBx_worksheetPath.Text, FileMode.Open))
{
if(fs == null)
{
theWorkbook = ExcelObj.Workbooks.Open(txtBx_worksheetPath.Text, 0, false, 5,
System.Reflection.Missing.Value, System.Reflection.Missing.Value, false, Excel.XlPlatform.xlWindows,"\t", true, false, 0, true, false, System.Reflection.Missing.Value);
}
}
}
catch(Exception)
{
// activate excel sheet
// theWorkbook.Activate();
}
Now, if the file is already open, then it performs nothing.
I dont want to close the excel sheet and reopen it.
Please help me.
Thanks
Ananya
|
|
|
|
|
I am working with World of Warcraft and C#. In WOW there is no way to send data out to another app nor are you allowed to use Spy++ to read data from WOW. A though occurred to me to simply create an Addon that draws a series of colored boxes near the top of the screen away from any that would get in the way of the users use of WOW. These colored boxes would represent a value I would read in via C# screen area capture. My question is, is this the best way to go about something like this or is there a better way?
|
|
|
|
|
I read an article here on CodeProject that used 3 programs to have Source Control in Visual Studio.
VisualSVN Server
TortoiseSVN
AnkhSVN
They all seem to do the job, and they all seem to do so fairly easily. I am wanting to use this just so I can host my personal project code on a server and not have to carry the code on a flash drive anymore (it is very unsettling to do so).
My question is has anymore used these before and can give a good review on them, OR does anyone have an idea of one that might fit a little better for my needs? I am just trying to store all my code(i.e. personal use) on a server with simple versioning, and access to the code from multiple laptops/desktops ect.
Thanks for any and all help, and I am positive that this is in the wrong forum, not sure where it goes, I used to post these kinds of questions in the Lounge, but it says no programming questions, and I don't want to put this in one of the more-or-less dead forums.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I got anxious and continued to do research while I waited for an answer. The only one I kept seeing over and over was VisualSVN, so I setup the server, installed the client, and it made me download TortoiseSVN. I don't need the 3rd one.
I have been playing around with it using my desktop, and laptop, and so far, I am loving it.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Good things come to those who wait, and do their own research
only two letters away from being an asset
|
|
|
|
|
I'm using this and it works very well. Looks & feels like VSS 6.
It's free for single user.
Everything makes sense in someone's mind
|
|
|
|
|
|
Why do you have to use LINQ ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi,
business requirement.
thanks
|
|
|
|
|
There is a LINQ forum
only two letters away from being an asset
|
|
|
|
|
Hello everybody,
I have a problem to which I haven't been able to find an answer through Google. I am making a windows service that reads image files in an input folder and then profiles the document in a document management system. The program can't manipulate images itself so it's OCR and Barcode reading, and image splitting, converting and combining functions are performed in separate applications using the System.Diagnostics.Process class.
The problem I am running into is that when I call my TiffSplitter app I get a System.OutOfMemoryException when I the image is first loaded into the program. In initial testing I found that I could set the "Allow service to interact with desktop" property of the service and it would run on my development PC but this quick fix didn't solve the problem on a client site.
I know that setting that property isn't a proper solution either so I'm open to ideas as to how to properly fix this. The reason this program is a service is so that it will auto start on system startup and doesn't require a windows user to log on to windows to start working. Is there any way of increasing the amount of memory that a process can use? Or is there some other solution that I'm missing?
Here some info about The PC's and the Program:
Development PC-
OS: WIN XP with SP2
Pentium 4 2.80GHz
2GB Ram
Client Server-
OS: WIN Server 2003
Runs on a virtual machine
TiffSplitter app-
vb6 app
Uses Imaging Pro to split and OCR Tiffs
Program loads fine but errors out on the image loading functions
Service app-
C# 2.0 app
Uses following code [Paraphrased] to open TiffSpliter:
using (Process p = new Process())
{
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = [args];
p.StartInfo.FileName = [exe];
p.Start();
p.WaitForExit();
p.Close();
}
modified on Friday, October 30, 2009 6:35 PM
|
|
|
|
|
Hi,
Fallout_Monkey wrote: I get a System.OutOfMemoryException
When we loop through some thing with out an End, we usually get this error.
So please check all your methods, or just create a log files for each method,
and identify is there any loop goes on.
Because your tiny program will have the sufficient memory untill some thing goes wrong.
(i have not given the solution, just its my observation on your post)
|
|
|
|
|
Thank you for your reply.
There is no infinite loop as your proposing. I know this because the exact same code will run on in a console app on the desktop with the same input. Also the line of code that throws the error is not in a loop.
|
|
|
|
|
If you're processing TIFF files, make sure your VB6 app isn't trying to display the image. GDI and GDI+ do not support JPEG compressed TIFF images, so this could be the cause of your problem. I'm not familiar with the library you're using so I cannot comment on the reliability of it.
|
|
|
|
|
Thank you for your reply.
The fact that it is a tiff has no bearing on this situation because I am not using GDI. I am using a third party control that is rendering and OCRing the image.
|
|
|
|
|
...and if that third-party control is using GDI...??
|
|
|
|