Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 访问公司防火墙.Net C后面的SmartSheet API_C#_Smartsheet Api - Fatal编程技术网

C# 访问公司防火墙.Net C后面的SmartSheet API

C# 访问公司防火墙.Net C后面的SmartSheet API,c#,smartsheet-api,C#,Smartsheet Api,我刚刚开始使用API更新智能工作表文档 使用SDK参考中的示例csharp读写表,只要我在开放的internet连接上,我就可以更新文档,但是,当我连接到公司LAN时,我不能更新文档,因为它正在报告代理身份验证问题 这是SDK中的代码 string accessToken = ConfigurationManager.AppSettings["AccessToken"]; if (string.IsNullOrEmpty(accessToken)) accessToken = Envir

我刚刚开始使用API更新智能工作表文档

使用SDK参考中的示例csharp读写表,只要我在开放的internet连接上,我就可以更新文档,但是,当我连接到公司LAN时,我不能更新文档,因为它正在报告代理身份验证问题

这是SDK中的代码

string accessToken = ConfigurationManager.AppSettings["AccessToken"];
if (string.IsNullOrEmpty(accessToken))
    accessToken = Environment.GetEnvironmentVariable("SMARTSHEET_ACCESS_TOKEN");
if (string.IsNullOrEmpty(accessToken))
    throw new Exception("Must set API access token in App.conf file");

// Get sheet Id from App.config file 
string sheetIdString = ConfigurationManager.AppSettings["SheetId"];
long sheetId = long.Parse(sheetIdString);

// Initialize client
SmartsheetClient ss = new SmartsheetBuilder().SetAccessToken(accessToken).Build();

// Load the entire sheet
Sheet sheet = ss.SheetResources.GetSheet(sheetId, null, null, null, null,     null, null, null);
Console.WriteLine("Loaded " + sheet.Rows.Count + " rows from sheet: " + sheet.Name);

您能否建议我如何配置API,以便向客户端API提供System.Net.WebProxy对象,从而通过公司代理提供身份验证路由?不幸的是,SDK没有公开底层WebRequest对象。 但是,您可以在app.config文件中指定代理信息

例如:

<configuration>
    <system.net>
        <defaultProxy>
            <proxy proxyaddress="http://my-actual-proxy-url" />
        </defaultProxy>
    </system.net>
</configuration>

请参阅相关问题:

@Steve Weil的回答不允许您提供用户凭据。。。。基于此的进一步研究最终解决了我的问题

好的,谢谢。。。但您能否在下一个发行周期中添加此功能。唯一的问题是,这不允许提供凭据。请参见下面我自己的答案,添加到我们的待办事项列表中